请大家帮我看一下我的这个C++程序有什么错误!

来源:百度知道 编辑:UC知道 时间:2024/05/22 16:52:20
我今天用一个C++程序编了一个计算星期几的程序,但是有几个错误不知道错在什么地方。请大家帮我看一下,是什么地方错误了。麻烦大家了。程序如下:
#include "stdafx.h"
#include "iostream.h"
void main(void)
{
int nnYear,nnMonth,nnDay;
int nnFebruary;
int nnTotadlDay,nnDayinMonth;

do
{
cout<<"请您输入日期:";
cout<<" year(1900---2100):";
cin>>nnMonth;
cout<<" month(1--12)";
cin>>nnMonth;
cout<<" Day(1--31)";
cin>>nnDay;
if (nnYear<=1900||nnYear>2100||nnMonth<1||nnMonth>12)
{
cout<<"输入有误"<<endl;
continue;
}

if ( ((nnYear%100!=0)&&!(nnYear%4))||(!(nnYear%100)&&!(nnYear%100)) )
nnFebruary=29;
else nnFebruary=28;
switch (nnMonth)
{
case1:
nnDayinMonth=31;
nnTotalDay=0;
break;

我看了一下
你写的比较简单,看起来比较累
直接提出问题就好了

#include "stdafx.h"
"stdafx.h" 这个文件在哪里呢?你没给出来

比较简单,但是太长了,,报了什么错说一下