小编Jak*_*ake的帖子

有没有更清晰的方法来编写这个Objective-c代码?

我是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)

c objective-c

4
推荐指数
1
解决办法
443
查看次数

标签 统计

c ×1

objective-c ×1