没有合适的资源?快使用搜索试试~ 我知道了~
C++编程题集.pdf
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 128 浏览量
2023-10-18
22:31:38
上传
评论
收藏 1.47MB PDF 举报
温馨提示
试读
77页
C++编程题集.pdf
资源推荐
资源详情
资源评论
Q5
(io
)
4
4 0 5 0
5 0 6 0
& 0 7 0
7 0 8 0
8 0
**
::
#in clude<iostream>
using namespace std;
int main()
{
int i; int i;
::
cin> >i;
if (i>=8) if (i>=8)
else if(i>=7&&i<8) else if(i>=7&&i<8)
else if(i>=6&&i<7) else if(i>=6&&i<7)
else if(i>=5&&i<6) else if(i>=5&&i<6)
else if (i>=4&&iv5) else if (i>=4&&iv5)
else if (i v 4) else if (i v 4)
Q6
(io
)
i 7 i 2
3
1 7
**
**
)
#in clude<iostream> using namespace std;
int main()
{
int n; int n;
cin >> n;
if (n >= 1 && n <= 7)
{
switch (n)
{
case 1: case 1:
break;
case 2: case 2:
break;
case 3: case 3:
break;
case 4: case 4:
break;
case 5: case 5:
break;
case 6: case 6:
break;
case 7: case 7:
break;
}
}
else else else
return 0;
}
Q7
(
10
)
io
1 10 2 10
4 30
**
**
cout cout
::
#in clude<iostream>
using namespace std;
int main()
{
double toStranger =0 01,toRichman=0;
for(i nt i=1;i<=30;i++)
{
toStra nger*=2;
toRichma n+=100000;
} }
}
Q8
(10 ) 1000000
:
sum=1071225
count =45
#i nclude <iostream>
using namespace std;
int main()
{
int i=1,count=0,s,sum=0;
do
{
s=i*i*i;
sum+=s;
coun t++;
i++
;
un t<<e ndl; return 0;
}
Q9
(10
)
1!+2!+3!+ +15!
#include <iostream>
using namespacestd;
int main()
{
int i,sum=1;
int n=15,s=0;
for(i=1;i<=n ;i++)
{
sum=sum*i;
s+=sum;
} }
return 0;
}
Q10
(10 ) 1 200 sum
1
sum=4227
#i nclude <iostream>
#in clude <cmath>
using namespace std;
int Prime(i nt m)
{
int i,k;
k=(i nt)sqrt(m);
for(i=2;i<=k;i++)
if(m%i==0) return 0;
return 1;
}
int main()
{
int a;
int sum=O;
for(a=2;a<=200;a++)
{
if(Prime(a))
{ {
}
}
cout«e ndl; e ndl;
return 0;
}
Q11
(10 ) C1
, C2
#in clude <iostream>
using namespace std;
int mai n()
{
int a[10] = {1,-2, 0, 4,-5, 0, 7, 8,-9, 10};
int cl = 0, c2 = 0;
int i;
for (i = 0; i < 10; i++)
if (a[i] > 0)
c1++;
else if (a[i] < 0)
c2++;
cout << cout << << c1 << en dl;
cout << cout << << c2 << en dl;
return 0;
}
Q12
(10 ) 10 a max min
#in clude <iostream>
using n amespace std;
int main()
{
int a[10] = {32, 43, 65, 23, 432, 543, 543, 54, 542, 87};
int i;
int max, min;
max = a[0], min = a[0];
for (i = 1; i < 10; i++)
{
if (a[i] > max) max = a[i];
if (a[i] < min) min = a[i];
}
cout << cout << ” << max << en dl;
cout << cout << ” << min << en dl;
return 0;
}
Q13
(10 ) while 1 100 sum
sum=166650
#in clude<iostream>
剩余76页未读,继续阅读
资源评论
hhappy0123456789
- 粉丝: 62
- 资源: 5万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- proteusntion-model-for-network-id开发笔记
- dockerntion-model-for-network-ids开发笔记
- 工程伦理e-MM-m开发笔记
- zlibrary-attention-model-for-network-i开发笔记
- matlab GUI仿真ntion-model-for-network-ids开发笔记
- 注意力机制t-JavaWeb-m开发笔记
- 雾霾分析的MATLAB GUI仿真程序
- 基于Matlab的超声场可视化研究及GUI仿真模拟
- DJ宏财-全外文FunkyHouse音乐总有一天你会出现在我身边必听精选专辑串烧.mp3
- kuzu 5.16(是2.18回锅饭).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功