7 条题解
-
2黎曜荣 (liyaorong) LV 5 @ 2023-10-25 20:25:00
#include <queue> #include <math.h> #include <stack> #include <stdio.h> #include <iostream> #include <vector> #include <iomanip> #include <string.h> #include <algorithm> using namespace std; const int N=1e5+10; const int INF=0x3f3f3f3f; char a[N]; int a1[N],c1[N],lenc; int x; int main(){ cin>>a; int lena=strlen(a);
for(int i=0;i<lena;i++) a1[i]=a[lena-i-1]-'0'; for(int i=lena-1;i>=0;i--){ c1[i]=(x*10+a1[i])/13; x=(x*10+a1[i])%13; } lenc=lena; while(c1[lenc]==0&&lenc>0) lenc--; for(int i=lenc;i>=0;i--){ cout<<c1[i]; } cout<<endl; cout<<x; return 0;
}
-
12023-10-25 20:27:07@
#include <queue> #include <math.h> #include <stack> #include <stdio.h> #include <iostream> #include <vector> #include <iomanip> #include <string.h> #include <algorithm> using namespace std; const int N=1e5+10; const int INF=0x3f3f3f3f; char a[N]; int a1[N],c1[N],lenc; int x; int main(){ cin>>a; int lena=strlen(a);
for(int i=0;i<lena;i++) a1[i]=a[lena-i-1]-'0';
for(int i=lena-1;i>=0;i--){ c1[i]=(x10+a1[i])/13; x=(x10+a1[i])%13;
}
lenc=lena; while(c1[lenc]==0&&lenc>0) lenc--; for(int i=lenc;i>=0;i--){ cout<<c1[i]; } cout<<endl; cout<<x;
return 0;
-
12023-10-25 20:24:56@
#include<bits/stdc++.h> using namespace std; const int n=1e5+10; const int inf=0x3f3f3f3f;
char a[n]; int la,lc,a1[n],c1[n],x,b=13; int main() { cin>>a; la=strlen(a); for(int i=0;i<la;i++){ a1[i]=a[la-i-1]-'0'; }
for(int i=la-1;i>=0;i--){ c1[i]=(x*10+a1[i])/b; x=(x*10+a1[i])%b; } lc=la; while(c1[lc]==0 && lc>0){ lc--; } for(int i=lc;i>=0;i--){ cout<<c1[i]; } cout<<endl<<x; return 0;
}
-
02024-3-23 17:42:16@
#include <iostream> #include <iomanip> #include <cmath> #include <cstdio> #include <cstring> #include <algorithm> #include <string> using namespace std; const int N=1e5+10; const int INF=0x3f3f3f3f; string a; int a1[N],lena,c1[N],x,lenc; int main(){ cin>>a; lena=a.size(); for(int i=0;i<lena;i++){ a1[i]=a[i]-'0'; } for(int i=0;i<lena;i++){ c1[i]=(x10+a1[i])/13; x=(x10+a1[i])%13; } while(c1[lenc]==0&&lenc<lena-1){ lenc++; } for(int i=lenc;i<lena;i++){ cout<<c1[i]; } cout<<endl<<x; return 0; }
-
02023-10-25 20:28:41@
#include <queue> #include <math.h> #include <stack> #include <stdio.h> #include <iostream> #include <vector> #include <iomanip> #include <string.h> #include <algorithm> using namespace std; const int N=1e5+10; const int INF=0x3f3f3f3f; char a[N]; int a1[N],c1[N],lenc; int x; int main(){ cin>>a; int lena=strlen(a);
for(int i=0;i<lena;i++) a1[i]=a[lena-i-1]-'0';
for(int i=lena-1;i>=0;i--){ c1[i]=(x10+a1[i])/13; x=(x10+a1[i])%13;
}
lenc=lena; while(c1[lenc]==0&&lenc>0) lenc--; for(int i=lenc;i>=0;i--){ cout<<c1[i]; } cout<<endl; cout<<x;
return 0;
😄
-
02023-9-26 22:31:35@
#include <bits/stdc++.h> using namespace std; int main() { int t,len,shang[300],yu = 0,b[150] = {0};//yu表示余数,shang[300]表示商 char a[150]; gets(a + 1); len = strlen(a + 1); for(int i = 1;i <= len;i++) { b[i] = a[i] - 48;//char转int b[i] = b[i] + yu * 10; yu = b[i] % 13;//得到余数 shang[i] = b[i] / 13;//得到商 } for(int j = 1;j <= len;j++)//用于删除前导0 { if(shang[j] != 0) { t = j; break; } } for(t;t <= len;t++)//此时t=j { cout << shang[t]; } cout << endl; cout << yu << endl; return 0; }
-
02022-3-26 8:58:08@
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; char a[1000]; int c[1000]; int main() { int num; cin >> a; int len = strlen(a); int sum = 0; for(int i = 0;i < len;i++) { sum = sum*10+a[i]-'0'; c[i]=sum/13; num = sum%13; sum=sum%13; } int l = 0; while(c[l]==0&&l<len-1) l++; for(int i=l;i < len;i++ ) cout << c[i]; cout << endl; cout << num; return 0; }
- 1
信息
- ID
- 1184
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 4
- 标签
- 递交数
- 160
- 已通过
- 70
- 上传者