随笔分类 - CSP1/2题
摘要:思路: 变量pre记录前一个数, cnt记录段数. 如果发现当前数与当前pre的值不同,段数+1. #include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n
阅读全文
摘要:思路: 先判断是不是闰年, 如果是, 使存月份天数的数组month二月的位置+1(即从28天变29天). 1 #include <iostream> 2 using namespace std; 3 int month[] {0, 31, 28, 31, 30, 31, 30, 31, 31, 30
阅读全文

浙公网安备 33010602011771号