Compile Error
/in/foo.cc: In function 'int main()': /in/foo.cc:6:11: warning: left operand of comma operator has no effect [-Wunused-value] for(i=0;i<n,i++) ~^~ /in/foo.cc:6:17: error: expected ';' before ')' token for(i=0;i<n,i++) ^ /in/foo.cc:9:2: error: expected ';' before '}' token } ^ /in/foo.cc:10:24: error: expected ';' before 'return' if(m>k)printf("Yes\n")return 1; ^~~~~~ /in/foo.cc:13:12: warning: left operand of comma operator has no effect [-Wunused-value] for(i=0;i<n,i++) ~^~ /in/foo.cc:13:18: error: expected ';' before ')' token for(i=0;i<n,i++) ^ /in/foo.cc:15:28: error: expected ';' before 'return' if(a[i]>m)printf("No\n")return 1; ^~~~~~ /in/foo.cc:17:18: error: expected ';' before 'return' printf("Yes\n")return 1; ^~~~~~ /in/foo.cc:20:11: warning: left operand of comma operator has no effect [-Wunused-value] for(i=0;i<n,i++) ~^~ /in/foo.cc:20:17: error: expected ';' before ')' token for(i=0;i<n,i++) ^ /in/foo.cc:25:8: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(t=0) ^ /in/foo.cc:26:17: error: expected ';' before 'return' printf("Yes\n")return 1; ^~~~~~ /in/foo.cc:28:2: error: expected ';' before 'for' for(i=0;i<n,i++) ^~~ /in/foo.cc:28:11: warning: left operand of comma operator has no effect [-Wunused-value] for(i=0;i<n,i++) ~^~ /in/foo.cc:28:17: error: expected ';' before ')' token for(i=0;i<n,i++) ^ /in/foo.cc:33:8: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(t=0) ^ /in/foo.cc:34:17: error: expected ';' before 'return' printf("Yes\n")return 1; ^~~~~~ /in/foo.cc:35:8: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(t=1) ^ /in/foo.cc:36:16: error: expected ';' before 'return' printf("No\n")return 1; ^~~~~~
代码
#include<stdio.h>
int main()
{
int n,m,k,i,a[1000],t;
scanf("%d%d%d",&n,&m,&k);
for(i=0;i<n,i++)
{
scanf("%d",&a[i])
}
if(m>k)printf("Yes\n")return 1;
if(m<k)
{
for(i=0;i<n,i++)
{
if(a[i]>m)printf("No\n")return 1;
}
printf("Yes\n")return 1;
}
t=0;
for(i=0;i<n,i++)
{
if(a[i]>m)
t=1;
}
if(t=0)
printf("Yes\n")return 1;
t=0
for(i=0;i<n,i++)
{
if(a[i]%(m+1)==0)
t=1;
}
if(t=0)
printf("Yes\n")return 1;
if(t=1)
printf("No\n")return 1;
}
信息
- 递交者
- 类型
- 递交
- 题目
- P1002 hitwh 2019 新生赛 C cqsss and his enterprise
- 语言
- C++
- 递交时间
- 2020-12-19 15:53:01
- 评测时间
- 2020-12-19 15:53:01
- 评测机
- 分数
- 0
- 总耗时
- 0ms
- 峰值内存
- 0 Bytes