Accepted
/in/foo.c: In function 'main': /in/foo.c:8:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if (a > b) ^~ /in/foo.c:10:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' a = b; ^ /in/foo.c:12:3: warning: 'tmp' may be used uninitialized in this function [-Wmaybe-uninitialized] printf("%d %d",a,b); ^~~~~~~~~~~~~~~~~~~
代码
#include<stdio.h>
int
main(void)
{
int a, b, tmp;
scanf("%d %d", &a, &b);
if (a > b)
tmp = a;
a = b;
b = tmp;
printf("%d %d",a,b);
return 0;
}
信息
- 递交者
- 类型
- 自测
- 题目
- 用if语句实现选择结构
- 语言
- C
- 递交时间
- 2018-10-26 00:12:09
- 评测时间
- 2018-10-26 00:12:09
- 评测机
- 分数
- 10
- 总耗时
- 1ms
- 峰值内存
- 192.0 KiB