check
yas 4 months ago
commit 058820ec38

16
00.sy

@ -0,0 +1,16 @@
int gcd(int a, int b) {
if (a == b){ return a; }
else if (a > b) { return gcd(a - b, b); }
else return gcd(b - a, a);
}
const int LF = 10;
int main(){
int a,b;
a = getint();
b = getint();
putint(gcd(a,b));
putch(LF);
return 0;
}

12
01.sy

@ -0,0 +1,12 @@
float LF = 1;
const int LF = 10;
int main(){
int a,b;
a = getint();
b = getint();
putint(gcd(a,b));
putch(LF);
return 0;
}
// Redefined Variable 重复定义变量/重复声明

17
02.sy

@ -0,0 +1,17 @@
int gcd(int a, int a) {
if (a == b){ return a; }
else if (a > b) { return gcd(a - b, b); }
else return gcd(b - a, a);
}
const int LF = 10;
int main(){
int a,b;
a = getint();
b = getint();
putint(gcd(a,b));
putch(LF);
return 0;
}
// Redefined Variable 函数形参重复定义

17
03.sy

@ -0,0 +1,17 @@
int gcd(int a, int b) {
if (a == b){ return a; }
else if (a > b) { return gcd(a - b, b); }
else return gcd(b - a, a);
}
void gcd(int a) {
return ;
}
int main(){
int a,b;
a = getint();
b = getint();
putint(gcd(a,b));
putch(LF);
return 0;
}
// Redefined Function 函数重复定义

@ -0,0 +1,9 @@
int main(){
int b;
a = getint();
b = getint();
putint(gcd(a,b));
putch(LF);
return 0;
}
// Use Undefined Variable 使用未定义变量

@ -0,0 +1,8 @@
int main(){
int a = 0,b = 0;
a = test();
b = getint();
test(a,b);
return 0;
}
// Use Undefined Function 使用未定义函数

14
06.sy

@ -0,0 +1,14 @@
int gcd(int a, int b) {
return 1;
}
int main(){
int a,b;
a = getint();
b = getint();
gcd(gcd(),gcd());
putint(gcd(a));
putch(LF);
return 0;
}
// Redefined Function 函数重复定义
// 不要出现这样的形式putint(gcd(a))putint是系统自带函数没有处理因为没有进行处理

11
07.sy

@ -0,0 +1,11 @@
float test(int a, int b) {
if (a+b==1){
return a+b;
}
return 0.1;
}
int main() {
float c = test(1,1);
return 0;
}
// Func Return Type Not Match 返回类型不匹配

11
08.sy

@ -0,0 +1,11 @@
int test(int a, int b) {
int d[1][2];
int c[10];
c[0.1] = 0;
return 1;
}
int main() {
int c = test(1,1);
return 0;
}
// Array index not int 数组下标不是整数

18
09.sy

@ -0,0 +1,18 @@
int test(int a, int b) {
int i = 0;
while (i <= 10) {
i = i + 1;
if ( i == 3 ) {
break;
}
}
return 1;
}
int main() {
int c = test(1,1);
continue;
return 0;
}
// Break not in loop break语句不在循环中

18
10.sy

@ -0,0 +1,18 @@
int test(int a, int b) {
int i = 0;
while (i <= 10) {
i = i + 1;
}
if ( i == 11 ) {
break;
}
return 1;
}
int main() {
int c = test(1,1);
continue;
return 0;
}
// Continue not in loop break语句不在循环中

12
11.sy

@ -0,0 +1,12 @@
int test(int a, int b) {
int c ;
c[10] = a + b;
}
int main() {
int c = test(1,1);
return 0;
}
// Visit non-array variable in the form of subscript variables 对非数组变量采用下标变量的形式访问

18
14.sy

@ -0,0 +1,18 @@
int main(){
int i = 1;
while (i < 9) {
int j = 1;
while (j < 0) {
int a = i * j * b;
c = a;
j = j + 1;
//if (j == 5) break;
}
d = j;
if (i == 5) break;
i = i + 1;
}
i = e * 5;
return 0;
}

11
20.sy

@ -0,0 +1,11 @@
int main(){
int a,b;
a = 0;
while (a < 10) {
c = c + a;
a = a + 1;
}
return 0;
}
Loading…
Cancel
Save