/ 科创班 /

记录详情

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);
   ^~~~~~~~~~~~~~~~~~~
# 状态 耗时 内存占用
#1 Accepted 0ms 184.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:12:45
评测时间
2018-10-26 00:12:45
评测机
分数
10
总耗时
0ms
峰值内存
184.0 KiB