#C0002. 程序查错(二)

程序查错(二)

下列程序各处都有错误,请在每个程序下面把修改后**完整的一行代码**写出,使程序能够正常运行(注意按照平时的格式写就好,不要有多余的空格,即能省空格就省空格)同时你还要标注行号,规定起始行为第1行,请把要修改的行所在的行号标注于修改的内容前,以空格隔开,如:1 #include<...

1、把20张图片平均分给7个同学,每人分得几张,还剩几张?

#include<bits/stdc++.h>
using namespace std;
int main()
{
	cout << 20%7 << endl;
	cout << 20.0\7 << endl;
	return 0
}

{{ input(1) }}
{{ input(2) }}
{{ input(3) }}

2、接下来是大家最爱的两变量交换代码

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,t;
	cin >> a >> b >> t;
	t = a;
	a = b;
	b = a;
	cout<<b<<a<<endl;
	return 0;
}

{{ input(4) }}
{{ input(5) }}
{{ input(6) }}
{{ input(7) }}