c-test.c-

来自「一个编译器的例子,基于c语言,在linux下开发 现在了简单的c语言例子」· C- 代码 · 共 54 行

C-
54
字号
/***  COMP51004-A   COMPILER**  Name: Yinghao Qin**  Username: yq11**  ID: 0130348** **  This is the test C- language file --- multi-line comments***/int getMax(int a, int b);int x,y;int main(){  //char type variable  char x='a';    int i= 1;  int average=0;  int result1=0,result2=0;   //display x  println("x :"~x);  //use 'while' loop calculating the sum from 1 to 1000       i = 1;  while(1)  {     result2=result2+i;     if(100==i) break;     else       i=i+1;  }  println("Result:"~result2);  //get the average value  average = result2/i;  average = getMax( average, result1);  println("The Max is :" ~ average);    return 0;}int getMax(int a, int b){  if (a>b)    return a;  else    return b;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?