#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int a, b,c,max;
while(scanf("%d%d%d",&a,&b,&c)==3){
if(a>=b&&a>=c) max=a;
if(b>=a&&b>=c) max=b;
if(c>=a&&c>=b) max=c;
printf("%d\n",max);
}
return 0;
}
自己設測資 123 3 25在網站上輸出不知道為什麼是25
但在自己電腦上輸出就是123
然後用long int宣告和用int在網站上的輸出通過的測資也都不一樣,覺得很奇怪
然後改用cin輸入就沒這個問題了,因為常常遇到這種問題,想請問一下原因,謝謝大家