用C语言编写:7+77+777+7777+77777计算五项的和

日期:2021-06-07 21:36:40 人气:1

用C语言编写:7+77+777+7777+77777计算五项的和

#include <iostream>
using namespace std;
void main()
{
int x=7,t=0,s=0;
for(int i=0; i<6; i++)
{
t+=x;
s+=t;
x=x*10;
}
cout<<s<<endl;
}
    A+
热门评论