> where C is the century (the left-most two digits of the year, for example, 19 if the year is 1948), Y is the year within the century (0-99)
Why are you ASKING for the century when the program spec clearly asks you for only year, month and day?
You CALCULATE the century from the year, you don't type it in.
Baby steps
A development process
Code:
#include <iostream>
using namespace std;
int main ( ) {
int Y,M,D; // Poor variable names, but it matches the spec
cin >> Y >> M >> D;
cout << "Year=" << Y << endl;
cout << "Month=" << M << endl;
cout << "Day=" << D << endl;
return 0;
}
Compile it, test it, make sure it works.
Code:
#include <iostream>
using namespace std;
int main ( ) {
int Y,M,D; // Poor variable names, but it matches the spec
cin >> Y >> M >> D;
cout << "Year=" << Y << endl;
cout << "Month=" << M << endl;
cout << "Day=" << D << endl;
int C;
// where C is the century (the left-most two digits of the year,
C = Y / 100;
Y = Y % 100;
cout << "Century=" << C << endl;
cout << "2 digit year=" << Y << endl;
return 0;
}
Compile it, test it, make sure it works.
Now you identify the next simple step to perform.