提交时间:2022-06-11 17:09:35
运行 ID: 41341
#include<bits/stdc++.h> using namespace std; int ans; int main(){ int n,ans=0; cin>>n; for(int x=1;x<=n;x++){ for(int y=1;y<=n;y++){ if(x!=y){ if((x+y)%3==0||(x+y)%7==0){ ans++; } } } } cout<<ans/2; return 0; }