怎么输出10的a次方啊a是变量

如何输出10的a次方啊,a是变量
void main()
{
int a,x;
a=3;
x=1ea;
printf("%d",x);

}
结果编译错误  
------最佳解决方案--------------------
引用:
引用:或者也可以调用 math 函数。
怎么调用

#include <cmath>
int b = pow(10,a);

------其他解决方案--------------------
int i=0,a=3,x=1;
for(;i<a;i++)
  x=x*10;
printf("%d",x);
------其他解决方案--------------------
或者也可以调用 math 函数。
------其他解决方案--------------------
首先,1e3这种写法是数学写法,编译器不认识,它只认识编程语言的语法
建议楼主不要想当然,好好学习基础知识

然后,10的a次方,循环a次每次乘10就行了
这种方法有问题,就是11次方以上的整数,int无法表示

最后,如果要求就是10的a次方,直接输出一个1后面输出a个0即可
------其他解决方案--------------------
引用:
或者也可以调用 math 函数。

怎么调用
------其他解决方案--------------------

#include<stdio.h>
#include<math.h>
void main()
{
  int a,b;
  scanf("%d",&a);
  b=pow(10,a);
  printf("10的%d次方为%d",a,b);
}

------其他解决方案--------------------
该回复于2012-11-08 19:56:31被管理员删除
------其他解决方案--------------------

int  a=9;
std::string s = "1";
s.append(a, '0'); //1000000000
int b = atoi(s.c_str());

------其他解决方案--------------------

int  a=9;
char buf[32];
sprintf(buf, "1%0*d",a, 0);//1000000000
int b = atoi(buf);

------其他解决方案--------------------
b=pow(10,a);

正解,记得添加#include<math.h>头文件
------其他解决方案--------------------
输出时也可以用%e输出。
------其他解决方案--------------------
//方法一 
 int a=3,x=1;
 for(int i =0;i<a;i++)
 {
  x*=a;
 }
 printf("%d",x);

//方法二
//pow(n,m)  平方函数 n是底数 m是幂
printf("%lf",pow(10,3));
------其他解决方案--------------------
//方法一 
  int a=3,x=1;
  for(int i =0;i<a;i++)
  {
   x*=10;
  }
  printf("%d",x);
 
//方法二
 //pow(n,m)  平方函数 n是底数 m是幂
 printf("%lf",pow(10,3)); 
------其他解决方案--------------------

#include <stdio.h>
int main
{
  int a, x;
  x = 1;
  for (a = 0; a < 6; a++)
    x = x * 10;
  printf("%d", x);

  return 0;
}

------其他解决方案--------------------