/ 科创班 /

记录详情

Wrong Answer

/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);
   ^~~~~~~~~~~~~~~~~~~~~
# 状态 耗时 内存占用
#1 Accepted 1ms 204.0 KiB
#2 Wrong Answer 1ms 188.0 KiB
#3 Accepted 0ms 188.0 KiB
#4 Accepted 0ms 204.0 KiB
#5 Accepted 0ms 188.0 KiB
#6 Wrong Answer 0ms 188.0 KiB
#7 Wrong Answer 0ms 200.0 KiB
#8 Accepted 0ms 188.0 KiB
#9 Wrong Answer 0ms 188.0 KiB
#10 Accepted 0ms 204.0 KiB

代码

#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:10:05
评测时间
2018-10-26 00:10:05
评测机
分数
60
总耗时
9ms
峰值内存
204.0 KiB