文章

21

粉丝

0

获赞

6

访问

1.5k

头像
打印日期 题解:
P1410 华中科技大学机试题
发布于2026年1月29日 16:05
阅读数 9

前导零printf补足方法,0x

 

#include <iostream>
#include <map>
#include <cctype>   // for isalpha, tolower
#include <string>
#include<algorithm>
#include<stack> 
#include<stdlib.h> //C打印库函数 
using namespace std;

bool runian(int year) {//4.100一组,中间不能被整除 
    return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
}
int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int main() {
    int year,day;
     while(cin>>year>>day){
         int m=1;
         int d=0;
         if(runian(year)){
             month[2]=29;
         }
         else{
             month[2]=28;
       &nb...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发