答案:2481215
#include<iostream> using namespace std; bool judge(int x, int y){ if(x>y){ int temp = x; x = y; y = temp; } if(x ==1&&y!=1) return true; for(int i = x; i>1; i--){ if(x%i==0&&y%i==0) return false; } return true; } int main() { int ans = 0; for(int i = 1; i<=2020; i++){ for(int j = 1; j <=2020; j++) if(judge(i,j)) ans++; } cout<< ans; return 0; }