fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. float power(int a,int b)
  5. {
  6. float S=1;
  7. for(int c=0;c<b;c++)
  8. S*=a;
  9. return S;
  10. }
  11.  
  12. int main()
  13. {
  14. int N;
  15. cin>>N;
  16. float T[N][N];
  17. for(int a=0;a<N;a++)
  18. {
  19. for(int b=0;b<N;b++)
  20. {
  21. T[a][b]=power(a+1,b+1);
  22. cout<<T[a][b]<<" ";
  23. }
  24. cout<<endl;
  25. }
  26. return 0;
  27. }
Success #stdin #stdout 0s 15240KB
stdin
10
stdout
1 1 1 1 1 1 1 1 1 1 
2 4 8 16 32 64 128 256 512 1024 
3 9 27 81 243 729 2187 6561 19683 59049 
4 16 64 256 1024 4096 16384 65536 262144 1.04858e+06 
5 25 125 625 3125 15625 78125 390625 1.95312e+06 9.76562e+06 
6 36 216 1296 7776 46656 279936 1.67962e+06 1.00777e+07 6.04662e+07 
7 49 343 2401 16807 117649 823543 5.7648e+06 4.03536e+07 2.82475e+08 
8 64 512 4096 32768 262144 2.09715e+06 1.67772e+07 1.34218e+08 1.07374e+09 
9 81 729 6561 59049 531441 4.78297e+06 4.30467e+07 3.8742e+08 3.48678e+09 
10 100 1000 10000 100000 1e+06 1e+07 1e+08 1e+09 1e+10