// for循环实现 int tnt; int i; tnt = 0; for (i = 1; i < 10 + 1; i++) tnt += i; cout << tnt << endl;
// while循环实现 int tnt; int i; tnt = 0; i = 1; while (i <= 10){ tnt += i; i += 1; } cout << tnt << endl;
正确
错误