※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
#include <stdio.h> // 引数も返値もない void print100Total(){ int total = 0; for (int i = 1; i <= 100; i++) { total += i; } printf("total: %i\n",total); } // 引数はあるが返値がない void printTotal(int n){ int total = 0; for (int i = 1; i <= n; i++) { total += i; } printf("total: %i\n",total); } // 引数も返値もある int getTotal(int n){ int total = 0; for (int i = 1; i <= n; i++) { total += i; } return total; } int main (int argc, const char * argv[]) { print100Total(); printTotal(100); printf("Total = %i!!\n",getTotal(100)); return 0; }
<< 前へ | 次へ >> |