大部分为打印题,意义不大.
7-1 Hello World! 分数 5
本题要求编写程序,输出一个短句“Hello World!”。
输入格式:
本题目没有输入。
输出格式:
在一行中输出短句“Hello World!”。
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
7-2 Welcome to You! 分数 5
本题要求编写程序,输出一个短句“Welcome to You!”。
输入格式:
本题目没有输入。
输出格式:
在一行中输出短句“Welcome to You!”。
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB
#include <iostream>
using namespace std;
int main()
{
cout << "Welcome to You!" << endl;
return 0;
}
7-3 Programming in C is fun! 分数 5
本题要求编写程序,输出一个短句“Programming in C is fun!”。
输入格式:
本题目没有输入。
输出格式:
在一行中输出短句“Programming in C is fun!”。
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB
#include <iostream>
using namespace std;
int main()
{
cout << "Programming in C is fun!" << endl;
return 0;
}
7-4 输出三角形 分数 5
本题要求编写程序,输出指定的由“*”组成的三角图案。
输入格式:
本题无输入
输出格式:
按照下列格式输出由“*”组成的三角图案。
****
***
**
*
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB
#include <iostream>
using namespace std;
int main()
{
cout << "****\n***\n**\n*" << endl;
return 0;
}
7-5 输出菱形图案 分数 5
本题要求编写程序,输出指定的由“A”组成的菱形图案。
输入格式:
本题无输入
输出格式:
按照下列格式输出由“A”组成的菱形图案。
A
A A
A
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB
#include <iostream>
using namespace std;
int main()
{
cout << " A\nA A\n A" << endl;
return 0;
}
7-6 输出带框文字 分数 5
本题要求编写程序,输出指定的带框文字。
输入格式:
本题无输入
输出格式:
按照下列格式输出带框文字。
************
Welcome
************
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB
#include <iostream>
using namespace std;
int main()
{
cout << "************\n Welcome\n************" << endl;
return 0;
}
7-7 What is a computer? 分数 5
本题要求编写程序,输出一个短句“What is a computer?”。
输入格式:
本题目没有输入。
输出格式:
在一行中输出短句“What is a computer?”。
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB
#include <iostream>
using namespace std;
int main()
{
cout << "What is a computer?" << endl;
return 0;
}
7-8 输出倒三角图案 分数 5
本题要求编写程序,输出指定的由“*”组成的倒三角图案。
输入格式:
本题目没有输入。
输出格式:
按照下列格式输出由“*”组成的倒三角图案。
* * * *
* * *
* *
*
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB
#include <iostream>
using namespace std;
int main()
{
cout << "* * * *\n * * *\n * *\n *" << endl;
return 0;
}
7-9 计算摄氏温度 分数 5
本题要求编写程序,计算华氏温度100°F对应的摄氏温度。计算公式:C=5×(F−32)/9,式中:C表示摄氏温度,F表示华氏温度,输出数据要求为整型。
输入格式:
本题目没有输入。
输出格式:
按照下列格式输出
fahr = 100, celsius = 计算所得摄氏温度的整数值
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB
#include <iostream>
using namespace std;
int main()
{
cout << "fahr = 100, celsius = " << (int)(5 * 68 / 9) << endl;
return 0;
}
7-10 计算华氏温度 分数 5
本题要求编写程序,计算摄氏温度26°C 对应的华氏温度。计算公式:F=9×C/5+32,式中:C表示摄氏温度,F表示华氏温度,输出数据要求为整型。
输入格式:
本题目没有输入。
输出格式:
按照下列格式输出
celsius = 26, fahr = 对应的华氏温度整数值
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB
#include <iostream>
using namespace std;
int main()
{
cout << "celsius = 26, fahr = " << (int)(9 * 26 / 5 + 32) << endl;
return 0;
}