摘要: a = str[i] - '0'什么意思: 如果str里面存放的是数字字符的话就是转成其数值类型 比如说str[i]是'1',其实ascii码值为0x31,而'0'的ascii码是0x30,用str[i]-'0'就得到了1 1、size()函数: c++中,在获取字符串长度时,size()函数与le 阅读全文
posted @ 2020-07-12 15:56 我来到,我看见 阅读(214) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; int main () { int a; long long b,c,d; cin>>a; int n[10][3]; for(int i=0;i<a;++i){ cin>> n[i][0]>>n[i][1]>>n[i] 阅读全文
posted @ 2020-07-12 13:11 我来到,我看见 阅读(78) 评论(0) 推荐(0)
摘要: #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 我来到,我看见 阅读(99) 评论(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 我来到,我看见 阅读(86) 评论(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 我来到,我看见 阅读(167) 评论(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 我来到,我看见 阅读(151) 评论(0) 推荐(0)