0 like 0 dislike
1.2k views
請設計一個程式,使用者輸入一個整數,程式會判斷該數是奇數還是偶數

 

輸入範例1:

10

輸出範例1:

even

輸入範例2:

99

輸出範例2:

odd
[Normal] Coding (C) - asked in 2016-1 程式設計(一)AD by (18k points)
ID: 13022 - Available when: Unlimited - Due to: Unlimited
| 1.2k views

21 Answers

0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>



int main()

{
** * *** *** * * ** ** ** n = 0 ;
*** * * ***** ****** * ***** * * * * * *

    
* ** * * * * * ** ** * n % 2 == 0 )
* * *** ** ** * **** * * ** * ***** * ** ****** ** *
* *** ** ** * **
* ***** * *** * * ** * ** ****** *** **** * * *** * ** *** *
** ** **** * * ***** *** **** * ** ** *** ****** **** *
*** *** *** **** ** * ** * ** *** ***
**** **** *** *** * *** **** 0;

}
answered by (-162 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>



int main()

{
*** * ******** ** * i;
***** * * * ** ** ****** * **** ** ** ** ***
* **** ** ***** * * * *** ** == 1)
* * ** ** **** ** ** * * **** ** **** * * * * *
* **** ** ** * ** * * *
** *** * *** ** ** * * *** * *** * * ** *
** * * * * * ******* * ***
** * *** ** * * ** * *** 0;

}
answered by (-202 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>



int main()



{
*** * * * * ****
** * *** * * *** * * x;
* *** ** * *
* * * ** ** ** * ** **** **** *
* * * ********* ***** ** ***
******** * ** * **** * ** **
* ** *** ** * **
* * ** * * ** ** ** ** * ** * * ***** * *** *

    
* * **** *** * *****
** ** ** ** **** * *
* **** ** *** * * * * ***** ***
** * * ** ** * * ** *
**** **** * ** ** **** *** * * ** * ** ****
* * *** * * ***
*** * * *** * 0;

    

}
answered by (122 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>



int main()

{
* * * * * ** * * i = 0;
** * *** ** * *** ** *
* *** **** * * * **** ** * ** ** **
* * * *** ** * * ** * *** **
* ****** ** * * *** * % 2 == 0)
** **** * ** ** * * * *** *** ***** **** * *** **     
*** ** ** * ** *
** ** * ***** * *** * ***

** ****** **** *** ** * ****** ** * * * ** * *
* ****** **** *** *
* * * * ** * **
*** ** *** ******* *
* *** * * * * * * * ** ** ********* *
* ****** * ** ** * * * 0;

}
answered by (-264 points)
0 like 0 dislike
Hidden content!
* *** * * * *
* *** ** ** * *


* *** * *
* ** * *



{

* * **



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

* ****

*** 0;



}



* * n)

{

* * * **

* ** * * * **



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

** * * ** * * *
* * * 0;

}
answered by (-186 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>

int main()

{
*** ***** * ** ** ***** num=0;
* *** *** **** * * * * * * * * ** **
** ** ** * *****
***** *** *** * * ** *** **
** * ** *** ** ** * *** * * * ** * ** ** * *
***** * * * * * * *****
* * * *** ** *** * ** *** ** * * **** *** ******* * * * * **
* * * * * ** *** * **** * * ** * **** **
* ** * * * * * 0;

}
answered by (156 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>



int main()

{
* * * * **** * ** a;
** * * * ** *** ** *** * * *** * ****** * * *
* * ** * **** * * * * * *
*** * * *** ** ***** * ** * ** * ******** * ** ** ** **** ***** * ** ***
** *** * * *
** * * ** **** ** ** ** *** * ** * *** * * * * * * **** * ***
* *** ** * ** ** *** * 0;



}
answered by (-146 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>



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

{
** * * ** **** *** * i;
** ** * * ** * ** * * * **** * *******
** * * **** ** * * * * **
* *** ** * * * ** ** * * ** * *** ** * ** *** ***** * ** *

* * * * * * ** ** ***
** * * * *** * * * ** * * * * ** * ** * *** *
* * * * **** ******** ** *** ** * * * ****** * * * *
* * * ** ** * ** * ** * 0;

}
answered by (-216 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

int main()

{
** * * * * ** *** *** num = 0;
* ** * * ***** * ** ** ** **** * * ** * * &num);
** * * * * * ***** **** (num % 2 != 0)
* ** *** * ** * * * * ** *
* ***** ** *** * **** ***** * * ** ***** ** ****** *   
*** * * ** * ** * *   
**** ** ** ** * * * * * *
*** ** * * **** * *** ***
* ** ** * * * * * * ** * ** **** * **** *** * **
* ** * * * ** *
** * * * *** * ** * ** 0;

}
answered by (-202 points)
0 like 0 dislike
Hidden content!
** ** * * **** * * ** ** * * * * * * * * ****** ** * *****



#include <stdio.h>

#include <stdlib.h>



int main()

{
* * * * * ** ** * * * * a;
*** ** ****** * * ** *** * ** ** ** ** , &a);

    
* ***** * **** * * * ** **
* * ** **** **** **** *** ** ** **
**** *** * ** ** * *
* * *** * ** ** *** ****
* * *** ***** * ** * **** ** ** **
* ** * ***** * ***
** * ** ** * *** ** *
** * ** ** ** * * *** * * * ** *** **
* * * * * * ** * * **** ** 0;
** ** * * *** **** *



}
answered by (-194 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.59.43
©2016-2024

Related questions

0 like 0 dislike
21 answers
[Normal] Coding (C) - asked Oct 13, 2016 in 2016-1 程式設計(一)AD by Shun-Po (18k points)
ID: 13421 - Available when: Unlimited - Due to: Unlimited
| 1k views
0 like 0 dislike
23 answers
[Normal] Coding (C) - asked Oct 11, 2016 in 2016-1 程式設計(一)AD by Shun-Po (18k points)
ID: 13024 - Available when: Unlimited - Due to: Unlimited
| 1.2k views
0 like 0 dislike
54 answers
[Normal] Coding (C) - asked Oct 11, 2016 in 2016-1 程式設計(一)AD by Shun-Po (18k points)
ID: 13021 - Available when: Unlimited - Due to: Unlimited
| 2.3k views
0 like 0 dislike
39 answers
[Exercise] Coding (C) - asked Oct 27, 2016 in 2016-1 程式設計(一)AD by Shun-Po (18k points)
ID: 15390 - Available when: 2016-10-27 18:30:00 - Due to: 2016-10-27 21:00:00
| 1.8k views
0 like 0 dislike
60 answers
[Exercise] Coding (C) - asked Oct 13, 2016 in 2016-1 程式設計(一)AD by Shun-Po (18k points)
ID: 13428 - Available when: Unlimited - Due to: Unlimited
| 2.6k views
12,783 questions
183,443 answers
172,219 comments
4,824 users