diff --git "a/data/1.\347\256\227\346\263\225\345\210\235\351\230\266/1.\350\223\235\346\241\245\346\235\257/\345\244\247\350\241\215\346\225\260\345\210\227/solution.cpp" "b/data/1.\347\256\227\346\263\225\345\210\235\351\230\266/1.\350\223\235\346\241\245\346\235\257/\345\244\247\350\241\215\346\225\260\345\210\227/solution.cpp" index 240a539d8b0a4f2c40250de4375adb001d90a841..a97c9e574c4e7ee9c584c32cc15dd9b61c1dff8c 100644 --- "a/data/1.\347\256\227\346\263\225\345\210\235\351\230\266/1.\350\223\235\346\241\245\346\235\257/\345\244\247\350\241\215\346\225\260\345\210\227/solution.cpp" +++ "b/data/1.\347\256\227\346\263\225\345\210\235\351\230\266/1.\350\223\235\346\241\245\346\235\257/\345\244\247\350\241\215\346\225\260\345\210\227/solution.cpp" @@ -3,7 +3,7 @@ int main() { int i; - for (i = 1; i < 20; i++) + for (i = 1; i <= 100; i++) { if (i % 2 == 0) printf("%d ", i * i / 2); diff --git "a/data/1.\347\256\227\346\263\225\345\210\235\351\230\266/1.\350\223\235\346\241\245\346\235\257/\345\244\247\350\241\215\346\225\260\345\210\227/solution.md" "b/data/1.\347\256\227\346\263\225\345\210\235\351\230\266/1.\350\223\235\346\241\245\346\235\257/\345\244\247\350\241\215\346\225\260\345\210\227/solution.md" index 021eb6d50654107b6e47e789c71e2f974826a150..1f7f316b612c6c45134fcf65e6de2f42dfe585fe 100644 --- "a/data/1.\347\256\227\346\263\225\345\210\235\351\230\266/1.\350\223\235\346\241\245\346\235\257/\345\244\247\350\241\215\346\225\260\345\210\227/solution.md" +++ "b/data/1.\347\256\227\346\263\225\345\210\235\351\230\266/1.\350\223\235\346\241\245\346\235\257/\345\244\247\350\241\215\346\225\260\345\210\227/solution.md" @@ -10,7 +10,7 @@ ## aop ### before ```cpp - +#include ``` ### after ```cpp @@ -19,21 +19,65 @@ ## 答案 ```cpp - +int main() +{ + int i; + for (i = 1; i <= 100; i++) + { + if (i % 2 == 0) + printf("%d ", i * i / 2); + else + printf("%d ", (i * i - 1) / 2); + } + printf("\n"); +} ``` ## 选项 ### A ```cpp - +int main() +{ + int i; + for (i = 1; i < 100; i++) + { + if (i % 2 == 0) + printf("%d ", i * i / 2); + else + printf("%d ", (i * i - 1) / 2); + } + printf("\n"); +} ``` ### B ```cpp - +int main() +{ + int i; + for (i = 1; i <= 100; i++) + { + if (i / 2 == 0) + printf("%d ", i * i / 2); + else + printf("%d ", (i * i - 1) / 2); + } + printf("\n"); +} ``` ### C ```cpp - +int main() +{ + int i; + for (i = 1; i <= 100; i++) + { + if (i % 2 == 0) + printf("%d ", i * i % 2); + else + printf("%d ", (i * i - 1) / 2); + } + printf("\n"); +} ```