⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 第十六题.cpp

📁 算法设计与分析——清华大学出版社 书后习题代码
💻 CPP
字号:
#include<iostream.h>
void main()
{
	int a,b,c,d,i;
	cout<<"please input a number from 1 to 100\n";
	
	cout<<"please input the number divided by 3 has a remainder of:";
	cin>>a;
	cout<<"please input the number divided by 5 has a remainder of:";
	cin>>b;
	cout<<"please input the number divided by 7 has a remainder of:";
	cin>>c;
	cout<<"let me think a moment/n";
	for(i=1;i<1500;i++)
		d=70*a+21*b+15*c;
	while(d>105)
		d=d-105;
	cout<<"your number is:"<<d;
}
/*心得:这个程序与书上给出的算法相同,我参照书上的算法的了此程序。*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -