0 喜歡 0 不喜歡
25.1k 瀏覽
請設計一程式,讓使用者輸入一個數字代表西元年,程式會判斷該年是不是閏年。

 

範例輸入1

2000

範例輸出1

2000 year is a leap year

範例輸入2

1900

範例輸出2

1900 year is not a leap year
[練習] Coding (C) - 最新提問 分類:作業 | 用戶: (18k 分)
ID: 12293 - 從幾時開始: 無限制 - 到幾時結束: 無限制

重新顯示 用戶: | 25.1k 瀏覽

201 個回答

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

#include ** ******



int main()

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


*** * **** * *** ** ***** ** (a%400==0)
** ** ** * ** ****** *** * *** ** * * ** ** ** * year is a leap year\n",a);
** **** *** * *** * ** *** * * if **** * * * * ***
** ** ***** ** * * *** **** * ** * * * * *** * **** year is a leap year\n",a);
* **** ** * ** * ** ** * * if (a%4!=0)
* ** * * * * * ** *** * * * * * * * ** ** ** *** ** * year is not a leap year\n",a);
* * * *** *** ** ** *** if ** ** * ** * *
** ****** **** ** **** ** * * * * ****** ** ** *** *** ** * *** year is not a leap * * *** ***
* *** * ** * * ** * ** 0;

}
最新回答 用戶: (-85 分)
0 喜歡 0 不喜歡
內容已隱藏
#include * * ** ** * *

#include * * ***** **



int main()

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


* *** * ***** * * * * *** (a%4==0)
** * * * * * * * * * **** *** * * ***** * * year is a leap year\n",a);
* * * ***** * ** if (a%4!=0)
*** * * ** *** * ** * ** **** ** * * ** ** * * * year is not a leap * ** **
* ** ** * * * ***** ** 0;

}
最新回答 用戶: (-85 分)
0 喜歡 0 不喜歡
內容已隱藏
** ** ** **



int * ** )



{
*** * * ** * ***** num;
* * * *** * ** ** ** ** ** **** * ***** ** );


** * * ** ** * * ( num % 400 == 0 )
* ** *
* ******* ** * * ** * * year is a leap **** * ** num );
** ** ** * *


* * *** * * * * if( num % 100 == 0 )
* * * * **** * *
* *** ****** * * * * * ** year is not a leap * *** ** * num );
****** * **** * *


** * *** ******* * ** * if( num % 4 == 0 )
** * ** ** ** *** ***
** * * * ***** * ** * * * * *** is a * * * * * num );
* * * ** * *********
* * * **** * ****
*** * **** * **
** * * **** * * ** * year is not a leap **** **** num );
* * * * * *




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

}
最新回答 用戶: (-124 分)
0 喜歡 0 不喜歡
內容已隱藏
*** ** * ** *** **



int * * )



{
* *** ** * * * * * num;
**** *** * * ** ** * ** ** * ** ** );


*** * * * ** * * ( num % 400 == 0 )
* ** * ***** ***
* * * **** *** * **** ** year is a leap ** num );
* ** *** * * *


**** ** ** * * ** if( num % 100 == 0 )
**** * * * * * * *
* * **** * **** ** * * * year is not a leap * * *** num );
** ****** ** * * *


* ** * **** * * * if( num % 4 == 0 )
* * ** ** *** * *
* * ** * ***** * * * * * * is a * * * num );
*** **** *** *****
** ******* ****** ***
** ** * *
* * * ** ** **** ** * * * * year is not a leap ** * num );
*** * * * *




** ** *** ** 0;

}
最新回答 用戶: (-82 分)
0 喜歡 0 不喜歡
內容已隱藏
** * * ** * ***
** **** * **** ****



int main()

{

int year;




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



if (year%4 !=0)
* * ** *** ** *** *** ***** * * is not a leap * * **** **


*** ** * * * *** * * * * * ** **** ** * ***** !=0))
* ** ** ******* ** ** ** * * * is a leap ** ** *** *




** * * ******** ** * * **** * * * * ** !=0))
* * ** * * * * ** * *** ** ** is not a leap **** ** * *


**** ** * * * ** * ** if(year%400==0)
* * * * * * * ** ***** * is a leap ** * ** **





}
最新回答 用戶: (-103 分)
0 喜歡 0 不喜歡
內容已隱藏
** * ** * *
** * ** * * * ***
***

{
* * ** ** * * * * * * * * *
* * * * **** **** * * *******


* ** * *** * *** (year % 4!=0)
* * ** ** ** *** * * ** * * year is not a leap ** * *


* ** **** *** ** *** **** if (year % 100!= 0)
***** ** **** * * * * * ** ***** year is a leap * ** year);


*** ******* * *** if (year % 400!=0 )
* *** * * * * *** * ** * * year is not a leap ** * year);


** ** ** ***** ** * *
** **** ***** * * * * * ** ** year is a leap * ***** year);


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

}
最新回答 用戶: (-103 分)
0 喜歡 0 不喜歡
內容已隱藏
#include * * ****

#include **** * * *

main()

{
* ** * * * * * year=0;
* * ****** *** *** ** * **** * * *** * * *
* *** * ** * * * * ** * * (year % 4 !=0)
* * * * *** ** ** ** * ** * * *** * * * ** ****** * * ***** year is not a leap * *** ** year);
* ** *** *** *** ** ** * if (year % 100 != 0)
** * ** * * * * * * * * * ***** * * * *** *** year is a leap **** year);
*** * *** * * * ** * if (year % 400 !=0 )
** *** * * **** ***** * * *** * * ** * * ** **** year is not a leap * ******** year);
** ** ** * *** **
**** ** *** ** ** * ** *** ** * ** * * *** * year is a leap ** * year);
* ** ** *** ** ***** *** * ***** * * * *** * * 0;

}
最新回答 用戶: (-103 分)
0 喜歡 0 不喜歡
內容已隱藏
* ** ** * * * ****
** * ** * **** **



int * *



{



int




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



if ** !=0)
* **** * ** * **** is not a leap **** *


* ** * * *** ****** ** * *
**** * * *** ** * * *** is a leap ********* ****** *



else ** ***** ** *** * ** ** **
******** * * *** ** * *** is not a leap * * * **



else * * * **
* *** * **** ** ** *** * * is a leap ** ** * ** **











}
最新回答 用戶: (54 分)
0 喜歡 0 不喜歡
內容已隱藏
* * * ** ** * * *** **


** **

{
* * *** * *


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


*** * % 4 != 0)
* * **** * * is not a ** * * ***
* *** % 4 ** * **** * * * % ** != 0))
***** *** *** is a * * * * ***
* % ***** ** *** * ** != **
* * ** ** *** is * a ** ** * ***

*** ** *** ** is a * * * *


** 0;

}
最新回答 用戶: (-50 分)
0 喜歡 0 不喜歡
內容已隱藏
* * * **** * *
*** *

{
** *
** ** ** *** * * ***** **
**** % 4
** * ** *** is not a ** **** ******
* % 100 *
* ** **** * * * is a * * *** * ** * *
*** * * * % 400 **
** *** ** * * * is not a * ** ** * *** ****
*
*** *** * * is a **** * * * ** * *
*** 0;

}
最新回答 用戶: (-72 分)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:104.23.197.65
©2016-2026

相關問題

0 喜歡 0 不喜歡
152 回答
[練習] Coding (C) - 最新提問 10月 5, 2016 分類:作業 | 用戶: Shun-Po (18k 分)
ID: 12295 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 17.5k 瀏覽
0 喜歡 0 不喜歡
131 回答
[練習] Coding (C) - 最新提問 10月 5, 2016 分類:作業 | 用戶: Shun-Po (18k 分)
ID: 12291 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 16.7k 瀏覽
1 喜歡 0 不喜歡
48 回答
[練習] 開放式問答 - 最新提問 11月 2, 2016 分類:作業 | 用戶: Shun-Po (18k 分)
ID: 16865 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 8.6k 瀏覽
0 喜歡 0 不喜歡
76 回答
[練習] Coding (C) - 最新提問 10月 19, 2016 分類:作業 | 用戶: Shun-Po (18k 分)
ID: 14120 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 11.3k 瀏覽
0 喜歡 0 不喜歡
91 回答
[練習] Coding (C) - 最新提問 10月 13, 2016 分類:作業 | 用戶: Shun-Po (18k 分)
ID: 13617 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 12.6k 瀏覽
12,783 問題
183,442 回答
172,219 留言
4,824 用戶