a005.
Eva 的回家作業
--
POJ
| From: [114.36.3.34] |
發表日期
:
2013-02-10 17:23
#include <stdio.h>
int main()
{
short num;
int in[4];
short i;
while(scanf("%d",&num)!=EOF)
{
while(num--)
{
for(i=0; i<4; i++)
{
scanf("%d",&in[i]);
}
for(i=0; i<4; i++)
{
printf("%d ",in[i]);
}
if(in[0] + in[2] == in[1]*2)
{
printf("%d",in[3]+(in[1]-in[0]));
}
else
{
printf("%d",in[3]*(in[1]/in[0]));
}
printf("\n");
}
}
return 0;
}
放上來跑之後 CE 出現了以下
它說我沒宣告變數 但我有阿O_O
code_1399038.c: In function ‘main’:
code_1399038.c:5: error: expected expression before ‘/’ token
code_1399038.c:5: error: stray ‘\346’ in program
code_1399038.c:5: error: stray ‘\254’ in program
code_1399038.c:5: error: stray ‘\241’ in program
code_1399038.c:5: error: stray ‘\346’ in program
code_1399038.c:5: error: stray ‘\225’ in program
code_1399038.c:5: error: stray ‘\270’ in program
code_1399038.c:6: error: expected expression before ‘/’ token
code_1399038.c:6: error: stray ‘\345’ in program
code_1399038.c:6: error: stray ‘\211’ in program
code_1399038.c:6: error: stray ‘\215’ in program
code_1399038.c:6: error: stray ‘\345’ in program
code_1399038.c:6: error: stray ‘\233’ in program
code_1399038.c:6: error: stray ‘\233’ in program
code_1399038.c:6: error: stray ‘\351’ in program
code_1399038.c:6: error: stray ‘\240’ in program
code_1399038.c:6: error: stray ‘\205’ in program
code_1399038.c:14: error: ‘i’ undeclared (first use in this function)
code_1399038.c:14: error: (Each undeclared identifier is reported only once
code_1399038.c:14: error: for each function it appears in.)
code_1399038.c:16: error: ‘in’ undeclared (first use in this function)
另外
我這樣寫
它會輸入一個數列
跳出一列答案
而不是連續輸入幾個數列再跳出答案
不知道怎麼改
求解 萬分感謝.