diff --git a/GESP/2023年6月GESP C++ 二级试卷解析.txt b/GESP/2023年6月GESP C++ 二级试卷解析.txt deleted file mode 100644 index d675903..0000000 --- a/GESP/2023年6月GESP C++ 二级试卷解析.txt +++ /dev/null @@ -1 +0,0 @@ -https://blog.csdn.net/abilix_tony/article/details/132529875 \ No newline at end of file diff --git a/GESP/New_WuHouFenTao_1.cpp b/GESP/New_WuHouFenTao_1.cpp index 69156b8..cdc5494 100644 --- a/GESP/New_WuHouFenTao_1.cpp +++ b/GESP/New_WuHouFenTao_1.cpp @@ -18,4 +18,4 @@ int main() { } } return 0; -} +} \ No newline at end of file diff --git a/GESP/Test.cpp b/GESP/Test.cpp index 27d78b7..a898627 100644 --- a/GESP/Test.cpp +++ b/GESP/Test.cpp @@ -1,37 +1,21 @@ #include using namespace std; +int a[1010]; int main() { - int T; - cin >> T; - while (T--) { - int a; - cin >> a; - string dw; - cin >> dw; - char dh; - cin >> dh; - char wh; - cin >> wh; - string dw2; - cin >> dw2; - int sum = 0; - // 我天~可算是录完了 - - if (dw == "m") - sum = a * 1000; - else if (dw == "km" && dw2 == "mm") - sum = a * 1000000; - else if(dw=="km"&&dw2=="m") - sum = a * 1000; - else if(dw=="kg"&&dw2=="mg") - sum = a * 1000000; - else if(dw=="kg"&&dw2=="g") - sum = a * 1000; - else if(dw=="g") - sum = a * 1000; - //计算完成!! - - cout << a << " " << dw << " = " <> n; + for (int i = 1; i <= n; i++) { + cin >> a[i]; } + for (int i = 1; i <= n; i++) { + for (int j = i + 1; j <= n; j++) { + int x; + x = a[i] + a[j]; + if (sqrt(x) * sqrt(x) == x) + cnt += 1; + } + } + cout << cnt; return 0; } \ No newline at end of file