摘要: #include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin>>a>>b; int c; c=(b-a); if(c%100>=50) c+1; //这里错误,应先换算成正常单位在进行+1的四舍五 阅读全文
posted @ 2020-07-12 13:10 我来到,我看见 阅读(97) 评论(0) 推荐(0)
摘要: //结果部分正确 #include<iostream> using namespace std; typedef long long ll; ll px(ll a,ll b) { ll p=0; if(a%10==b) { p=p*10+b; a=a/10; } return p; } int ma 阅读全文
posted @ 2020-07-12 12:38 我来到,我看见 阅读(84) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; int main() { int n; char c; int row; cin>>n>>c; for(int i=1;i<=n;i++) { row=i; if(row==1||row==n) { for(int j= 阅读全文
posted @ 2020-07-12 01:27 我来到,我看见 阅读(163) 评论(0) 推荐(0)
摘要: 错误答案1:#include<iostream> using namespace std; const int maxn=100000; int a[maxn]={0}; int main(){ int n,id,sco,k,j; cin>>n; for(int i=0;i<n;i++){ a[id 阅读全文
posted @ 2020-07-12 00:12 我来到,我看见 阅读(150) 评论(0) 推荐(0)
摘要: 1001 害死人不偿命的(3n+1)猜想 写后总结:数字与字母相乘,乘法不能省略;注意局部变量的位置;别光写算法,把"输出"忘记写.这是一个部分正确的,原因是什么?#include<iostream> using namespace std; int main() { //int max=1000; 阅读全文
posted @ 2020-07-11 21:45 我来到,我看见 阅读(101) 评论(0) 推荐(0)
摘要: 一、算法原理 冒泡算法的本质是交换--数组元素间的对比交换+数组元素递增比较(确保最后一个肯定是最大的)+趟数用递增减少次序。 二、程序 #include<iostream> using namespace std; int main() { int n[5]={3,1,4,5,2}; for(in 阅读全文
posted @ 2020-07-11 03:59 我来到,我看见 阅读(297) 评论(0) 推荐(0)
摘要: #include<stdio.h>这个叫头文件 math.h数学函数 string.h跟字符串有关的函数-strlen、strcmp、strcpy、strcat、memset 等价写法 如cstdio,把“.h”换成 “c”开头 c/c++混合写法,命名.cpp。选择语言C++ 或G++ #incl 阅读全文
posted @ 2020-07-06 02:31 我来到,我看见 阅读(173) 评论(0) 推荐(0)