求程序设计判断大小

[复制链接]
查看11 | 回复1 | 2010-12-5 07:41:46 | 显示全部楼层 |阅读模式
Description
给出两个正整数a、b,试判断a、b的大小关系。
Sample Input
1 2
5 6
13 7
9 9
Sample Output
17
9=9
Source
AOA
下面第一个答案Compile Error,具体:2/19/118653.cpp: In function ‘int main()’:
2/19/118653.cpp:13: error: expected `;' before ‘if’
2/19/118653.cpp:15: error: expected primary-expression before ‘else’
2/19/118653.cpp:15: error: expected `;' before ‘else’
请改完后上传,多谢~~~~
第二个答案Compile Error,具体:2/19/118654.cpp: In function ‘int main()’:
2/19/118654.cpp:7: error: expected primary-expression before ‘;’ token
第三个答案Wrong Answer

回复

使用道具 举报

千问 | 2010-12-5 07:41:46 | 显示全部楼层
1.#include#includeint main(void) {int nNum1,nNum2; printf("请输入第一个整数:"); scanf("%d",&nNum1); printf("\n请输入第二个整数:\n"); scanf("%d",&nNum2); printf("\n输入的两个数为:%d,%d,其大小关系为:",nNum1,nNum2) if(nNum1 < nNum2){printf("%d < %d",nNum1,nNum2); }elseprintf("%d &gt
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行