上一页 1 ··· 4 5 6 7 8
摘要: 解题思路:找字符位置的规律。除了最后一行为2n-1个字符全部输出,其余行的字符位置满足pos1==n+i-1和pos2=n-i+1(i为行数,从1开始) #include <stdio.h> using namespace std; int main() { char a; int n; while 阅读全文
posted @ 2021-01-20 17:58 FantasticDoulbeFish 阅读(1008) 评论(0) 推荐(0) 编辑
摘要: 解题思路: 先考虑这个人没有18岁生日的情况。显然只有可能是2月29日出生的,而且出生后的第18年一定不是闰年(18不是4的倍数)。因此,2月29日出生的人没有18岁生日,输出-1。 再考虑不是2月29日出生的情况,当年生日到第二年生日所经过的天数,不是365天,就是366天。之所以有时候会经过36 阅读全文
posted @ 2021-01-20 17:10 FantasticDoulbeFish 阅读(412) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; #include <iostream> int main() { int n;//测试数据组数 cin >> n; while(n --) { int m; cin >> m;//输入测试的奇数 for(int i = 阅读全文
posted @ 2021-01-19 20:37 FantasticDoulbeFish 阅读(768) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <cmath> using namespace std; int main() { int n;//定义整数 while(scanf("%d",&n)!=EOF)//输入整数n { for(int i=1;i<2*n;i++)//要打印的行数 阅读全文
posted @ 2021-01-19 19:34 FantasticDoulbeFish 阅读(702) 评论(0) 推荐(0) 编辑
摘要: 首次搭建个人博客 阅读全文
posted @ 2020-05-15 15:54 FantasticDoulbeFish 阅读(53) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8