Browse Source

平方取中

爱玲姐姐 5 years ago
parent
commit
97333649e4
1 changed files with 14 additions and 0 deletions
  1. 14 0
      B.cpp

+ 14 - 0
B.cpp

@@ -0,0 +1,14 @@
+#include<bits/stdc++.h>
+using namespace std;
+int main(){
+    int n;
+    cin >> n;
+    if (n < 256) {
+        n += 256;
+    }
+    n = (n << 16) >> 16;
+    n *= n;
+    n = (n << 8) >> 16;
+    cout << n << endl;
+    return 0;
+}