aaa爱aaa奇aaa艺术教育aaa会aaa员aaa出aaa租aaa。只要,a八aaa块aaa钱。aas

上传时间:
56官方微信
扫一扫发现精彩> 怎么用for循环实现a+aa+aaa+aaaa+。请各位大侠帮忙
怎么用for循环实现a+aa+aaa+aaaa+。请各位大侠帮忙
oqryxf02 & &
发布时间: & &
浏览:2 & &
回复:2 & &
悬赏:0.0希赛币
如何用for循环实现a+aa+aaa+aaaa+。。。。请各位大侠帮忙这是我写的程序
不要笑话哈#include &stdio.h&void main(){ &
int a,n,sum1=0,sum2=0,i=1,j,p; &
scanf(&%d,%d&,&a,&n); &
for(j=1;j&=n;j++)
a=a*10^(j-1);
sum1=sum1+a;
printf(&%d&,sum1);
& }我写的不行 还请各位大侠帮忙
自己写的一个,符合要求:  C/C++ code  #include&stdio.h&
void main()
int i,j,n;
scanf(&%d&,&n);
for(i=0;i&n;i++)
for(j=0;j&=i;j++)
printf(&a&);
printf(&+&);
oracle01 & &
00:10:25 & &
& & (1)(0)引用额 这个不是强制转换···C++写习惯了!你试下这个就行了 int a,n,sum1=0,j,p; scanf(&%d,%d&,&a,&n); p=a; for(j=0;j &j++) {
sum1=sum1+a;
a=a*10+p; } printf(&%d&,sum1);
return 0;输入时,两个数用逗号隔开& 探讨1楼 你用for(int j=0;j&n;j++) 强制转换int没有加()
而且j没有定义 解决这两个问题还是没有输出oracle001 & &
00:10:25 & &
& & (0)(0)引用
本问题标题:
本问题地址:
温馨提示:本问答中心的任何言论仅代表发言者个人的观点,与希赛网立场无关。请对您的言论负责,遵守中华人民共和国有关法律、法规。如果您的言论违反希赛网问答中心的规则,将会被删除。
暂无合适的专家
&&&&&&&&&&&&&&&
希赛网 版权所有 & &&This site requires JavaScript and Cookies to be enabled. Please change your browser settings or upgrade your browser.Select a State
A-AAAKey Mini Storage provides secure, convenient and clean self storage for our customers at a reasonable price. The key to our success is our storage facility managers’ commitment to excellent customer relationships.
As a national leader and innovator in the self storage industry, A-AAAKey Mini Storage has grown to 42 self storage facilities in 9 states. As a three-time award winner of the Mini-Storage Messenger’s prestigious “FACILITY OF THE YEAR” award, we have shown that we know what you are looking for in self storage.
If you need to un-clutter a garage, move a family member, store business records or equipment, join the many thousands of customers who have experienced the peace of mind that comes with storing your goods at an A-AAAKey Storage Facility!At A-AAAKey Mini Storage:
You do business directly with the actual self storage facility manager.
Our managers are empowered to provide you with all of your self storage needs.
We build and maintain only first-class facilities to further enhance your self storage experience.
Our level of commitment to you is what we believe will bring you back the next time you need storage.
The Corporate Headquarters of A-AAAKey Mini Storage is located in
Get Started Now:&&&&&&&&&&&&
* - at select facilities, on select sizes and subject to availability
WHAT MAKES US DIFFERENT?
Just a buck covers your first month’s rent.* The competition
claims it, but WE MEAN IT!&
Use your own lock or purchase one at our facility. They make you buy
one of theirs.
Insurance not mandatory.& They require you to buy their policy.
At A-AAAKey Mini Storage a dollar is a dollar. Everywhere
else the “cha-ching” never stops!1016人阅读
C语言(89)
//求Sn=a+aa+aaa+------+aaaaaaa(n个a),其中a和n都从键盘中输入,如从键盘中输入2,5,则计
//算S5=2+22+222+。
#include&stdio.h&
int main()
int a,n;//a是数字,n是次数
int sn=0,tn=0;//sn是累积和的值,tn是计算第几位时值是多少!
//循环变量
scanf(&%d %d&,&a,&n);
//第一种求和方式
for(i=1;i&=n;i++)
tn=tn+a;//第几位时值是多少
//第二种求和方式
for(i=1;i&=n;i++)
tn=tn*10;//这一句和下面一句不能交换
printf(&%d\n&,sn);
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:428797次
积分:10615
积分:10615
排名:第1118名
原创:631篇
转载:174篇
评论:29条
(8)(11)(27)(68)(46)(46)(56)(79)(71)(70)(148)(131)(45)

我要回帖

更多关于 aaa艺术教育 的文章

 

随机推荐