ltx_zero

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页

2019年8月19日

摘要: 《算法笔记》3.5小节——入门模拟->进制转换 A题 注意,这个里面因为两个都是满int,所以会出现爆int,不仅仅sum用longlong,a和b也需要,pat B1022里面就不会爆 (实测a和b在int时候题目会报错,因为int和long貌似不能直接转换成long long,只保留底字符什么的 阅读全文
posted @ 2019-08-19 20:12 ltx_zero 阅读(97) 评论(0) 推荐(0) 编辑

2019年8月18日

摘要: 《算法笔记》3.4小节——入门模拟->日期处理 D无难度,注意格式是yyyy-mm-dd,年也是要补足的,样例里面没有提醒但是自己要注意啊!! #include<stdio.h> int month[13][2]={0,0,31,31,28,29,31,31,30,30,31,31,30,30,31 阅读全文
posted @ 2019-08-18 11:19 ltx_zero 阅读(114) 评论(0) 推荐(0) 编辑

2019年8月17日

摘要: 《算法笔记》3.4小节——入门模拟->日期处理 B题跟A题类型一样,多组输入初始化刚开始不小心放在外面了,看了好久 这种在发生错误的时候结果会发生变化,单输入又没问题的,考虑一下是不是在新的一轮忘记了初始化 #include<stdio.h> #include<string.h> using nam 阅读全文
posted @ 2019-08-17 14:08 ltx_zero 阅读(82) 评论(0) 推荐(0) 编辑

2019年8月16日

摘要: 《算法笔记》3.4小节——入门模拟->日期处理 A日期差值 不难,但是需要非常谨慎 刚开始的时候把想到的问题都列出来了,思路还是比较清晰的 这种情况下出错的几个地方:数组初始值对应平年闰年写反了,isrun传参数的时候,应该传入year手误传入了data 思考过程中认为 从A->B这里面计算A天,B 阅读全文
posted @ 2019-08-16 23:52 ltx_zero 阅读(108) 评论(0) 推荐(0) 编辑

2019年8月15日

摘要: 《算法笔记》3.3小节——入门模拟->图形输出 C无难度 #include<stdio.h> int main() { int n; scanf("%d",&n); while(n--) { int h; scanf("%d",&h); for(int i=1;i<=h;i++) { for(int 阅读全文
posted @ 2019-08-15 17:29 ltx_zero 阅读(94) 评论(0) 推荐(0) 编辑

2019年8月14日

摘要: 《算法笔记》3.3小节——入门模拟->图形输出 B无难度 注意一下最后一排,有两个数是被重复计算进去的,然后最后U下方处的len是n1+n2-1,对应数是str[n1+n2-2] #include<stdio.h> #include<string.h> #include<string> using 阅读全文
posted @ 2019-08-14 21:21 ltx_zero 阅读(76) 评论(0) 推荐(0) 编辑

2019年8月13日

摘要: 《算法笔记》3.3小节——入门模拟->图形输出 A无难点,注意一下刚开始公式直接用5算的,实际上用h来表示,还有就是加2i要减2,因为i从1开始。 #include<stdio.h> int main() { int h; while(scanf("%d",&h)!=EOF) { for(int i 阅读全文
posted @ 2019-08-13 12:06 ltx_zero 阅读(65) 评论(0) 推荐(0) 编辑

2019年8月4日

摘要: PAT B1036 题本身没难点,注意三目运算符在0这个位置自己简写容易搞混,还是少用,还有是判定奇偶用%但是真正len是用/,题本身没难度,注意一下吧 四舍五入是奇数加一n/2+1 #include<stdio.h> #include<string.h> using namespace std; 阅读全文
posted @ 2019-08-04 19:29 ltx_zero 阅读(51) 评论(0) 推荐(0) 编辑

2019年8月3日

摘要: 《算法笔记》3.2小节——入门模拟->查找元素 E无难点 #include<stdio.h> #include<string.h> using namespace std; struct student { char id[256]; char name[256]; char gender[256] 阅读全文
posted @ 2019-08-03 20:29 ltx_zero 阅读(90) 评论(0) 推荐(0) 编辑

2019年8月2日

摘要: 《算法笔记》3.2小节——入门模拟->查找元素 D无难点 #include<stdio.h> #include<iostream> using namespace std; #include<string.h> int main() { int n,m; int searchnum,num[105] 阅读全文
posted @ 2019-08-02 13:39 ltx_zero 阅读(112) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页