解题思路:
注意事项:输入整数及其个数的范围条件
参考代码:
#include <stdio.h>
#include <math.h>
int main(int argc, char *argv[]) {
int a,n,t=0,i=0;
long int s = 0;
scanf("%d %d",&a,&n);
if(((a>=1)&&(a<=9)) && (n>=1)&&(n<=9)){
while(i<n){
t = a*pow(10,i)+t;
s += t;
i++;
}
}
printf("%ld",s);
return 0;
}
0.0分
0 人评分
C二级辅导-进制转换 (C语言代码)浏览:514 |
C二级辅导-公约公倍 (C语言代码)浏览:2123 |
C语言程序设计教程(第三版)课后习题10.1 (C语言代码)浏览:1449 |
程序员的表白 (C语言代码)浏览:1473 |
Hello, world! (C语言代码)浏览:1208 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:554 |
C语言程序设计教程(第三版)课后习题9.2 (Java代码)浏览:638 |
WU-输出九九乘法表 (C++代码)浏览:1672 |
C语言程序设计教程(第三版)课后习题9.2 (C语言代码)浏览:556 |
Cylinder (C语言描述,蓝桥杯)浏览:1247 |