随笔分类 - 江南信息学每周练习题解
摘要:1001:奥运乒乓球一局比赛结果1因为输入的数据是比赛后,所以谁大谁赢1002: 奥运乒乓球一局比赛结果2如果A要赢,那么必须要满足a-b大于等于2并且a大于等于11分的情况,B要赢也是同理,否则就是要继续1003:求最小值设minn等于较大值,循环n遍,每次输入x时和minn比较出较小值1004:
阅读全文
摘要:比赛链接 1001 C语言实验题――三个整数记得保留2位小数是%.2f 1 #include<bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 int a,b,c; 6 cin>>a>>b>>c; 7 printf("%d %d %.2
阅读全文
摘要:比赛链接 1001:三个数的最大值 条件判断,如判断a最大就是a>=b && a>=c,以此类推 #include<bits/stdc++.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; cout<<max(a,max(b,
阅读全文
摘要:比赛链接 1001:C语言实验题――找中间数 三个判断,如 if(a>=b&&b>=c)那就是b #include<bits/stdc++.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if(b>=a && a>=c||c
阅读全文
摘要:1001 : 分数乘法 #include<bits/stdc++.h> using namespace std; float a,b,c,d; int main() { char t; cin>>a>>t>>b>>t>>c>>t>>d; printf("%.3f",a/b*c/d); return
阅读全文
摘要:比赛链接 1001: 排座位 找规则,可以发现对于n个位置最多可以坐n/2向上取整个人 python: #1.排座位 n = int(input()) if n%2==0: #判断n是否是偶数 print(int(n/2))#对n/2保留整数 else: print(int(n/2+1)) View
阅读全文
摘要:比赛链接 1001: 神奇的力学 重力 = 支持力,所以输入的重力是什么,支持力就是什么 #include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; cout<<a; return 0; } View Code 1
阅读全文
摘要:比赛链接 1001 : 圆的直径 #include<bits/stdc++.h> using namespace std; int main() { int r; cin>>r; cout<<r*2; return 0; } View Code 1002 : 人犬同行 #include<bits/s
阅读全文
摘要:比赛链接 1001 : 长方形的周长 python: a = int(input()) b = int(input()) print((a+b)*2) View Code C++: #include<bits/stdc++.h> #include<iostream> using namespace
阅读全文
摘要:比赛链接 6436计算表达式的值 python: a,b = map(int,input().split()) print(3*a+2*b) View Code C++: #include <bits/stdc++.h> using namespace std; int main() { int x
阅读全文
摘要:1001:给定一个字符,用它构造一个对角线长3个字符,倾斜放置的菱形 python: c = input() print(' '+c) print(c+c+c) #3*c print(' '+c) View Code C++: #include<iostream> #include<bits/std
阅读全文