1.
#include "pch.h"
#include <iostream>
using namespace std ;
int main()
{
int a, b;
cout << "请输入两个任意整数:\n" ;
cin >> a >> b;
cout << "两者和为:" << a + b << "\n" ;
cout << "两者积为:" << a * b << "\n" ;
cout << "这是程序结尾\n" ;
}
2.
#include "pch.h"
#include <iostream>
using namespace std ;
int main()
{
cout << "************************************************************\n\n" ;
cout << " ccc sss !!\n" ;
cout << " c c s !!\n" ;
cout << " c sss !!\n" ;
cout << " c c s !!\n" ;
cout << " cc sss 0 0 \n" ;
cout << "\n" ;
cout << "************************************************************\n" ;
cout << "成功完成!!!" ;
}
3.
#include "pch.h"
#include <iostream>
using namespace std ;
int main()
{
int a, b, c;
cout << "请输入25美分硬币数:\n" ;
cin >> a;
cout << "请输入10美分硬币数:\n" ;
cin >> b;
cout << "请输入5美分硬币数:\n" ;
cin >> c;
cout << "一共是:" << a * 25 + b * 10 + c * 5 << "美分\n" ;
}
4.
#include "pch.h"
#include <iostream>
using namespace std ;
int main()
{
int t;
double g,h;
g = 9.8 ;
cout << "请输入坠落时间:\n" ;
cin >> t;
h = g * t*t;
cout << "自由落体距离是:\n" <<h/2 ;
}
5.
#include "pch.h"
#include <iostream>
using namespace std ;
int main()
{
char X;
cout << "请输入字母:\n" ;
cin >> X;
cout << X << X << X << X;
}