The following program is my ACcepted code for NTHU-7520 .
It's a for everybody to learn and discuss.
If there is any mistake or comment, please let me know. :D
此乃NTHU 7520 的AC code!
點這裡看題目 Click here to see this Problem!
要切成兩部分,並且兩部分的重量都是不為零的偶數
所以如果是偶數就對了
但是2不為答案 (因為 2 = 2 + 0)
至少要4以上的偶數
//This program is for NTHU 7520 PA - Watermelon
//題目來源 Problem link: http://acm.cs.nthu.edu.tw/problem.php?pid=7520
#include<stdio.h>
int main()
{
int n;
while(scanf("%d", &n) != EOF)
if(n % 2 || n == 2)
printf("NO\n");
else
printf("YES\n");
return 0;
}
Please feel free to use it after adding this blog as an reference. (http://autekroy.blogspot.tw) If there is any mistake or comment, please let me know. :D
歡迎使用與分享任何內容,但請記得標示此部落格為出處。(http://autekroy.blogspot.tw/) 如果有發現任何的錯誤與建議請留言或跟我連絡。 : )
It's a for everybody to learn and discuss.
If there is any mistake or comment, please let me know. :D
此乃NTHU 7520 的AC code!
歡迎一同討論學習,如有錯誤與任何建議請留言 : )
點這裡看題目 Click here to see this Problem!
要切成兩部分,並且兩部分的重量都是不為零的偶數
所以如果是偶數就對了
但是2不為答案 (因為 2 = 2 + 0)
至少要4以上的偶數
//This program is for NTHU 7520 PA - Watermelon
//題目來源 Problem link: http://acm.cs.nthu.edu.tw/problem.php?pid=7520
#include<stdio.h>
int main()
{
int n;
while(scanf("%d", &n) != EOF)
if(n % 2 || n == 2)
printf("NO\n");
else
printf("YES\n");
return 0;
}
Please feel free to use it after adding this blog as an reference. (http://autekroy.blogspot.tw) If there is any mistake or comment, please let me know. :D
歡迎使用與分享任何內容,但請記得標示此部落格為出處。(http://autekroy.blogspot.tw/) 如果有發現任何的錯誤與建議請留言或跟我連絡。 : )
沒有留言:
張貼留言
請留下您的任何想法或建議!
Please leave any thought or comment!