fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i;
  5. unsigned long a = 1; // aを初期化
  6. unsigned long result[1] = {1}; // 配列の大きさは1のまま
  7.  
  8. for (i = 0; i < 10; i++) {
  9. result[0] = a; // 正しいインデックスで配列に代入
  10. a = a * 3; // aを3倍
  11.  
  12. printf("%lu\n", result[0]); // 結果を出力
  13. }
  14.  
  15. return 0; // 正常終了
  16. }
  17.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
1
3
9
27
81
243
729
2187
6561
19683