Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
73120 文 15相同数的次数 C++ Accepted 0 MS 264 KB 309 2024-05-17 22:56:16

Tests(1/1):


Code:

#include<iostream> using namespace std; /** * */ int main(){ int n=1000; int a,b; a=b=1; int sum=0; while(n){ a%=20; b%=30; if(a==b) { sum++; // cout<<a<<" "<<b<<" "<<sum<<endl; } a++; b++; // cout<<n<<endl; n--; } cout<<sum+1; return 0; }