问题九十四: An Easy Task
[plain]
#include <stdio.h>
int main()
{
int y;
int n;
int num;
int count;
scanf("%d", &num);
while(num--)
{
scanf("%d %d", &y, &n);
count=0;
do
{
if( (y%4==0 && y%100!=0 ) || (y%400==0))
{
count++;
}
y++;
}while(count<= n-1);
printf("%d", y-1);
if(num>0)
{
printf("\n");
}
}
}
#include <stdio.h>
int main()
{
int y;
int n;
int num;
int count;
scanf("%d", &num);
while(num--)
{
scanf("%d %d", &y, &n);
count=0;
do
{
if( (y%4==0 && y%100!=0 ) || (y%400==0))
{
count++;
}
y++;
}while(count<= n-1);
printf("%d", y-1);
if(num>0)
{
printf("\n");
}
}
}
补充:软件开发 , C语言 ,