C++程序与语言设计第四版上机题库 下载本文

~

参考程序如下: #include using namespace std; int main() {

cout<<\ cout<<\ 我喜欢程序设计!\\n\

cout<<\ system(\ return 0; }

评分标准:

1、写出能完成题目要求功能的、可正常运行的C++程序,给满分,否则0分 ~~~a

编写一个程序,在屏幕上显示如下信息: ############################### 信息化是新“新四化”的核心! ############################### ~

参考程序如下: #include using namespace std; int main() {

cout<<\ cout<<\ 信息化是新“新四化”的核心!\\n\

cout<<\ system(\ return 0; }

评分标准:

1、写出能完成题目要求功能的、可正常运行的C++程序,给满分,否则0分 ~~~a

编写一个程序,在屏幕上显示如下信息: ***** * * * * * * * * * * * * * * * * * 姓 名 成绩 张三丰 98 李 刚 50

***** * * * * * * * * * * * * * * * * * ~

参考程序如下: #include using namespace std;

int main() {

cout<<\ cout<<\姓 名\\t\\t成绩\\n\ cout<<\张三丰\\t\\t98\\n\ cout<<\李 刚\\t\\t50\\n\

cout<<\ system(\ return 0; }

评分标准:

1、写出能完成题目要求功能的可正常运行的C++程序,给满分,否则0分 ~~~a

编写一个程序,在屏幕上显示如下信息:

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 学号 姓名 131114100 李元芳 131124100 刘贤良

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ~

参考程序如下: #include using namespace std; int main() {

cout<<\ cout<<\学号\\t\\t姓名\\n\ cout<<\李元芳\\n\ cout<<\刘贤良\\n\

cout<<\ system(\ return 0; }

评分标准:

1、写出能完成题目要求功能的、可正常运行的C++程序,给满分,否则0分 ~~~a

编写一个程序,在屏幕上显示你的班级、学号和姓名。 ~

参考程序:

#include using namespace std; int main() {

cout<<\班级 \\t\\t\\t学号\\t\\t\\t姓名\\n\

cout<<\移动终端\\t\\t131164988\\t\\t李元芳\\n\ system(\ return 0; }

评分标准:

1、写出能完成题目要求功能的、可正常运行的C++程序,给满分,否则0分 ~~~a

从键盘输入梯形的上下底边长和高,计算梯形面积。 ~

参考程序:

#include using namespace std; int main() {

double x,y,h,s;

cout<<\请输入梯形的上下底边长和高:\ cin>>x>>y>>h; s=(x+y)*h/2 ;

cout<<\梯形面积是:\ system(\ return 0; }

评分标准:

1、写出能完成题目要求功能的、可正常运行的C++程序,给满分,否则0分 ~~~a

华氏温度转换为摄氏温度的计算公式如下: F=32+C*9/5

其中C表示摄氏温度,F表示华氏温度。输入摄氏温度,编程输出华氏温度。 ~

#include using namespace std; int main() {

float C,F;

cout<<\输入摄氏温度数:\\n\ cin>>C;

cout<

cout<<\等值的华氏温度为:\ system(\ return 0; }

评分标准:

1、写出能完成题目要求功能的可正常运行的C++程序,给满分,否则0分

~~~a

已知:1公吨=35273.92盎司,编程输入公吨数,输出盎司数。 ~

#include using namespace std; int main() {

float x,y;

cout<<\输入公吨数:\\n\ cin>>x;

y=35273.92*x;

cout<

评分标准:

1、写出能完成题目要求功能的可正常运行的C++程序,给满分,否则0分 ~~~a

编写一个程序,在屏幕上显示如下信息: ############################### 我一定能学好C++!

我一定能成为C++高手! ############################### ~

参考程序:

#include using namespace std; int main() {

cout<<\ cout<<\ 我一定能学好C++!\

cout<<\ 我一定能成为C++高手!\

cout<<\ system(\ return 0; }

评分标准:

1、写出能完成题目要求功能的可正常运行的C++程序,给满分,否则0分 ~~~a

编写显示下列内容的程序: *************************** * 请爱护教室卫生! *