鱼儿恋上水
鱼儿恋上水
全部文章
题解
计算机历年考研复试上机题(1)
归档
标签
去牛客网
登录
/
注册
计算机历年考研复试上机题
What does not kill you makes you stronger!
全部文章
/ 题解
(共57篇)
还是A+B
来自专栏
#include <iostream> #include <cstdio> #include <cmath> using namespace std; int main(){ int A, B, K; while(~scanf("%d %d %d"...
2020-03-29
1
818
对称平方数1
来自专栏
#include <iostream> #include <cstdio> #include <string> using namespace std; bool check(int n){ string s; s = to_string(n); ...
2020-03-29
7
829
平方因子
来自专栏
#include <iostream> #include <cstdio> #include <cmath> using namespace std; bool check(int n){ for(int i = 2; i <= (int)sqrt(...
2020-03-29
1
1123
最大公约数1
来自专栏
执行速度(从快->慢):__gcd()algorithm库函数>gcd更相减损术与移位结合>gcd1更相减损术>gcd2辗转相除法 #include <iostream> #include <cstdio> #include <climits&g...
2020-03-28
2
802
n的阶乘
来自专栏
#include <iostream> using namespace std; typedef long long ll; int main(){ int n; while(cin >> n){ ll fac = 1; for...
2020-03-27
0
573
阶乘
来自专栏
#include <iostream> #include <cstring> #include <algorithm> #include <string> using namespace std; struct bign{ int d[3000...
2020-03-27
1
596
N的阶乘
来自专栏
参考链接:大数阶乘(N!)问题https://www.jianshu.com/p/39eaa57f9b38解题思路:将正整数N从1到N逐位相乘,即1 * 2 * 3...... * (N-1) * N。每次相乘后的值会存储到array[ ]中,其中一个数组元素中存储值中的一位数。当值小于10时直接存...
2020-03-26
1
1019
阶乘
来自专栏
20以内的阶乘用long long长整型存储即可long long 为64位整数类型,一般的long long为64位,由于负数补码的原因,第一位作为符号位,因此有63位可用。则取值范围为-2^63到2^63-1 20的阶乘有19位数,等于2432902008176640000 2^63-1=9...
2020-03-25
1
1042
进制转换2
来自专栏
类似题目:http://poj.org/problem?id=1220高精度进制转换原理:https://www.cnblogs.com/kuangbin/archive/2011/08/09/2132467.html①利用整型数组存储参考博客:https://www.cnblogs.com/bhl...
2020-03-24
6
816
进制转换
来自专栏
%x:以16进制数的方式,从键盘输入一个整数存到变量中%d:以10进制数的方式 #include <stdio.h> int main() { int num = 0; while (~scanf ("%x", &num)) printf("%d...
2020-03-24
23
870
首页
上一页
1
2
3
4
5
6
下一页
末页