使用c++ 输出2 4 8 3 9 29 4 16 64 5 25 125

[复制链接]
查看11 | 回复3 | 2012-3-30 11:45:25 | 显示全部楼层 |阅读模式
2 4 8 3 9 27 4 16 64 5 25 125 Press any keyto continue#include int main(){using std::cout;for (int i=2;i<6;i++)cout<#includeint main(){ int i=2,j=1,n; for(i;i<=5:i++)
for(j;j<=3;j++)
n*=i;cut<<setw(2)<<n;reant 0;}for循环不像while,do......
回复

使用道具 举报

千问 | 2012-3-30 11:45:25 | 显示全部楼层
#includevoid main(){for(int i=2;i<=5;i++){int s=1;for(int j=0;j<3;j++){s*=i;cout<<s<<" ";}}}...
回复

使用道具 举报

千问 | 2012-3-30 11:45:25 | 显示全部楼层
你的数列应该是2 4 8 3 9 27 4 16 64 5 25 125吧?是不是你给错了?...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行