View Code of Problem 68

#include<stdio.h>
#include<math.h>
int main(void)
{
  int a,b,c,d,max;
  printf("请输入三个整数:");
  scanf("%d%d%d",&a,&b,&c);
  d=(a>b)?a:b;
  max=(c>d)?c:d;
  printf("最大的数是%d\n",max);
  return 0;
}
/*
Main.c: In function 'main':
Main.c:5:3: error: stray '\357' in program
   int a,b,c,d,max;
   ^
Main.c:5:3: error: stray '\274' in program
Main.c:5:3: error: stray '\214' in program
Main.c:5:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'd'
   int a,b,c,d,max;
               ^
Main.c:7:25: error: 'c' undeclared (first use in this function)
   scanf("%d%d%d",&a,&b,&c);
                         ^
Main.c:7:25: note: each undeclared identifier is reported only once for each function it appears in
Main.c:8:3: error: 'd' undeclared (first use in this function)
   d=(a>b)?a:b;
   ^
Main.c:9:3: error: 'max' undeclared (first use in this function)
   max=(c>d)?c:d;
   ^
*/

Double click to view unformatted code.


Back to problem 68