将这段代码转化为C++代码:Program e5_4_1(input,output); var a,b,c,max:integer; begin assign(input,'e5_4_1.in'); reset(input); assign(output,'e5_4_1.out'); rewrite(output); readln(a,b,c); if a>b then max:=a else max:=b; if c>max then max:=c; writeln('max=',max); close(input); close(output); end.
时间: 2023-05-27 11:05:56 浏览: 61
#include <stdio.h>
int main()
{
FILE *input, *output;
int a, b, c, max;
input = fopen("e5_4_1.in", "r");
output = fopen("e5_4_1.out", "w");
fscanf(input, "%d%d%d", &a, &b, &c);
if (a > b)
max = a;
else
max = b;
if (c > max)
max = c;
fprintf(output, "max=%d", max);
fclose(input);
fclose(output);
return 0;
}
阅读全文