| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 149593 | 徐英杰 | 15相同数的次数 | C++ | Accepted | 0 MS | 260 KB | 671 | 2026-03-14 16:32:58 |
#include <iostream> using namespace std; int main() { int n = 1; int a = 1; int b = 1; int cnt = 0; // while (n <= 1000) { // if ( a > 20) { // a = 1; // } // if ( b > 30) { // b = 1; // } // if (a == b) { // cnt++; // } // a++; // b++; // n++; // } for (int n = 1;n <= 1000;n++) { if ( a > 20) { a = 1; } if ( b > 30) { b = 1; } if (a == b) { cnt++; } a++; b++; } cout<<cnt; return 0; }