我是Objective-c和编程的新手.我是一名护理人员,我决定学习目标课程.我对c有一些经验,这就是为什么这个程序以这种方式编码的原因.我想知道是否有一种更有效的方法来使用objective-c进行编码?谢谢.(程序编译时没有错误,所以如果在某处出现语法错误,可能是因为我是新手在代码块内的板上转义字符)
#import <Foundation/Foundation.h>
void calcDiagnosis (float pHInput, int paCO2Input, int hCO3Input);
int main (int argc, const char * argv[]){
int i;
int repeat;
i = 0;
for(i = 0; i < 3; i++){
//Initialize lab value variables
float pH;
int paCO2;
int hCO3;
//Introduction
NSLog(@"Welcome to the ABG Lab Value Interpreter v1.0\n");
NSLog(@"Please enter the necessary values.\n");
//Gather the necessary values
NSLog(@"Enter the pH value:");
scanf("%f", &pH);
NSLog(@"Enter the PaCO2 value:");
scanf("%i", &paCO2);
NSLog(@"Enter the HCO3 value:");
scanf("%i", &hCO3);
calcDiagnosis …Run Code Online (Sandbox Code Playgroud)