0 喜歡 0 不喜歡
4.3k 瀏覽

12. There are some mistakes in the code, please fix them by using your compiler, and post your code here. 

(can be answered 2 times)

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
int a

scanf("%d",a);

if(a%2!=0){
	print("Odd");
}else

print("Even");

	return 0;
}

 

[考試] 最新提問 分類:Mid-term examination | 用戶: (5.9k 分)
ID: 32695 - 從幾時開始: 無限制 - 到幾時結束: 2017-11-15 16:10
| 4.3k 瀏覽

21 個回答

0 喜歡 0 不喜歡
內容已隱藏
*** **** **
**** * ** ** **

int argc, char ** {
int a;

* ** ** ** ** * * ** * ** **

* *
* ** * * * * * ******* *** ** * ** * *
***

** * ** ** * *****

* ** * return 0;
}
100/100 最新回答 用戶: (192 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
** * ** * ****
* * * ** * *****

int *** * argc, char *** * {
int a;

*** ***** *

* *
** * * ** * * ** * * * * *

else
* *** * **** * **

* ** * *** ** 0;
}
100/100 最新回答 用戶: (221 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
** * * * * * * *
* ** * * * *

int ** * argc, char * * {
int a;

** *** * * * ** * * **** *

** *** *
* * *** * * * ** * * * * *
}
**

** ** * ***** * *

** * * ** * * 0;
}
100/100 最新回答 用戶: (244 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
* * * * * *
***** *** *** *******

int ***** argc, char ** {
int a;

*** * **** * ** ****** * ** *

** *
** ** * **** ** * ** * *
*

******** ** * ** * *

* * * ** ** return 0;
}
100/100 最新回答 用戶: (153 分)
0 0
prog.c: In function 'main':
prog.c:7:9: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
 scanf("%d",a);
         ^
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
* * ** * ** *
* * *** * * ** ***

int *** argc, char ** {
int a;
*** * * *** * * * * *

* ** ***
** * ***** *** ******* * **
* * *

* * ** *** * * ***

* * * * * *** return 0;
}
100/100 最新回答 用戶: (283 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
* ** ** *** * ***** *
* * * **

int main(int argc, char *argv[]) {
int a;

** **** * * * * *** *

* ***
** * ***** *
** ** ** * ** ** * ** * * * ** *
}
else
* * *** ****** * ** ** * *** ** * *

*** * ** ***** ** ** 0;
}
100/100 最新回答 用戶: (227 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
* ** *** * **** *
* * * * *** *** **

int argc, char * ** {
int a

* * * *** ** *

** *
* * * * * **** * * * * **
*
** *
* ***** ** ** ** * *
}
* * * * ** return 0;
}
1/100 最新回答 用戶: (449 分)
0 0
prog.c: In function 'main':
prog.c:7:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
 scanf("%d",a);
 ^~~~~
prog.c:7:12: error: 'a' undeclared (first use in this function)
 scanf("%d",a);
            ^
prog.c:7:12: note: each undeclared identifier is reported only once for each function it appears in
prog.c:10:2: warning: implicit declaration of function 'print' [-Wimplicit-function-declaration]
  print("Odd");
  ^~~~~
0 喜歡 0 不喜歡
內容已隱藏
** * ** * *****
* * ** * * ***

int ** argc, char ** ** {
int a;

* ** * * *** * *****

* **
* * * * *** * ** **
* *

* *** *** *** *

** * * *** *** return 0;
}
100/100 最新回答 用戶: (246 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
* * * ** *
*** * * * ** * * *

int * * ** argc, char ** * {
int a;

* ****** * *** * *

* * ***
** * * ** * * *** **
***

** *** * * * * **

** * * * * * ** return 0;
}
100/100 最新回答 用戶: (254 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
****** ** * * *
* **** *** *

int ** ** argc, char ** ** {
int a;

* * * * * ***** **

** * **
* * ** * *** * *** * **** * *
* *

* * * * * * *

** * * * * return 0;
}
100/100 最新回答 用戶: (220 分)
0 0
Case 0: Correct output
Case 1: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.59.82
©2016-2025

相關問題

0 喜歡 0 不喜歡
21 回答
[考試] 最新提問 11月 15, 2017 分類:Mid-term examination | 用戶: nat236919 (5.9k 分)
ID: 32690 - 從幾時開始: 無限制 - 到幾時結束: 2017-11-15 16:10
| 4.3k 瀏覽
0 喜歡 0 不喜歡
18 回答
[考試] 最新提問 11月 14, 2017 分類:Mid-term examination | 用戶: nat236919 (5.9k 分)
ID: 32199 - 從幾時開始: 無限制 - 到幾時結束: 2017-11-15 16:30
| 4.1k 瀏覽
0 喜歡 0 不喜歡
22 回答
[考試] 最新提問 11月 14, 2017 分類:Mid-term examination | 用戶: nat236919 (5.9k 分)
ID: 31997 - 從幾時開始: 無限制 - 到幾時結束: 2017-11-15 16:10
| 2.6k 瀏覽
0 喜歡 0 不喜歡
22 回答
[考試] 最新提問 11月 14, 2017 分類:Mid-term examination | 用戶: nat236919 (5.9k 分)
ID: 31985 - 從幾時開始: 無限制 - 到幾時結束: 2017-11-15 16:10
| 2.5k 瀏覽
0 喜歡 0 不喜歡
20 回答
[考試] 最新提問 11月 14, 2017 分類:Mid-term examination | 用戶: nat236919 (5.9k 分)
ID: 31981 - 從幾時開始: 無限制 - 到幾時結束: 2017-11-15 16:10
| 2.2k 瀏覽
12,783 問題
183,442 回答
172,219 留言
4,824 用戶