02-03-2012, 08:33 PM
Lo scopo di questo esercizio e di programmare un programma che in base ad un valore letto in textbox ti dice se l'anno è bisestile o meno ..
Ecco un esempio in C++
Ecco un esempio in C++
Codice:
// Anno Bisestile.cpp
#include "stdafx.h"
#include "iostream"
using namespace std;
int main()
{
int anno;
cout<<"Inserire un anno : ";
cin>>anno;
if ((anno%400==0)||(anno%100!=0)&&(anno%4==0))
{
cout<<"L'anno "<<anno<<" e' bisestile";
}
else
{
cout<<"L'anno "<<anno<<" non e' bisestile";
}
system("pause");
return 0;
}