错题
啊轩好菜
这个作者很懒,什么都没留下…
展开
-
【无标题】
链接:登录—专业IT笔试面试备考平台_牛客网 来源:牛客网 小明前几天看书看累了,脑海中突然闪过,这书的页码也很可爱啊。一本书的页码从自然数1按自然顺序编码到n.每个页码不会含有多余的前导数字0.例如,第6页用数字6表示,而不是06、006表示。下面问题来了,你能帮忙小明解决以下问题:给定总页码n,计算出书的全部页码中分别用到的多少次数字0,1,2,...,9. #include<stdio.h> int main() { long long n; while(~scanf("%l原创 2022-05-05 19:52:42 · 91 阅读 · 0 评论 -
杭电 汉诺塔集合 1995 1996 2064 2077 2175
都是要找规律,还有对递归的了解 hd 1995 #include<iostream> #include<string.h> using namespace std; short result[100]; int main(){ int times,plants,no,pow; cin>>times; while(times--){ cin>>p...原创 2022-04-22 11:11:23 · 81 阅读 · 0 评论 -
杭电oj 2036 多边形的面积
#include<iostream> using namespace std; int main() { int n; while(scanf("%d",&n) != EOF && n ) { int i; double a[100],b[100]; for(i = 0;i < n; i++) scanf("%lf%lf",&a[i],&b[i])...原创 2022-04-10 00:07:06 · 126 阅读 · 0 评论 -
杭电oj 2031 进制转换
#include<stdio.h> int main() { char w[6]= {'A','B','C','D','E','F'}; char a[1000]; int n,r,i,z; while(~scanf("%d %d",&n,&r)) { i=0,z=0; if(n<0) //要考虑正负数 { n=-n; z=1;...原创 2022-04-09 23:59:43 · 269 阅读 · 1 评论 -
杭电2028 N个数的最小公倍数
#include<iostream> using namespace std; #define ll long long int fun(ll int a,ll int b){ return b?fun(b,a%b):a; //三目运算符 等价于 if(b) fun(b,a%b); else a; } int main() { ll n; while(cin>>n&&n){ ll a[1100]; a[0]=1; for(l...原创 2022-04-09 23:54:22 · 228 阅读 · 0 评论 -
玩具谜题(洛谷-P1563)用pair做题
小南有一套可爱的玩具小人,它们各有不同的职业。 有一天,这些玩具小人把小南的眼镜藏了起来。小南发现玩具小人们围成了一个圈,它们有的面朝圈内,有的面朝圈外,如下图: 这时 `singer` 告诉小南一个谜题:「眼镜藏在我左数第 3 个玩具小人的右数第 1 个玩具小人的左数第 2 个玩具小人那里。」 小南发现,这个谜题中玩具小人的朝向非常关键, 因为朝内和朝外的玩具小人的左右方向是相反的:面朝圈内的玩具小人,它的左边是顺时针方向,右边是逆时针方向;而面向圈外的玩具小人,它的左边...原创 2022-04-04 20:27:27 · 197 阅读 · 0 评论 -
牛兄牛弟
还是c++好用呀!!! 可能会有错误,欢迎大家指点 #include<iostream> #include<algorithm> using namespace std; int main() { int n,d,i,j,a[10000],b[10000]; cin>>n>>d; for(i=0;i<n;i++) cin>>a[i]; for(i=0;i<n;i++) { so...原创 2022-04-03 20:29:37 · 641 阅读 · 0 评论