#include //缺少了#include "stdafx.h"头文件
void main()
{
int year;
bool IsLeap Year; //变量名有误,不能有空格,下面的同一个变量,你写了几个版本!
cuot<<"Enter the year:";
cin>>year;
isleap year=((year%4==0&&year%100!=0)||(year%400=0)); //应该是year%400==0,少了个=号,意义就不一样了
if (isleap year) //这里的变量名同上
cout< else
cuot<}
程序修改如下:
#include "stdafx.h"
#include
void main()
{
int year;
bool IsleapYear;
cout<<"Enter the year:";
cin>>year;
IsleapYear=(year%4==0&&year%100!=0)||(year%400==0);
if (IsleapYear)
cout< else
cout<
}
--------------------next---------------------
阅读(1150) | 评论(0) | 转发(0) |