Need help with basic subtraction formatting

I am writing a program that is supposed to compare how old someone is in relation to recent events. I have gotten to the stage where I can put in some of the events but I am having some issues on how the formatting works. I studied this a few days ago but I cannot find my old resources on how to do it. Thank you in advance for helping.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//this code is for determining age relations to events in recent history
#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int main()
{cout << "If you would like to use the program type in 1. If you do not type in 2" << endl;
int wwe;
cin >> wwe;

    do {
    cout << "What is your name?"<< endl;
    string name;
    cin >> name;
    cout << "Okay " << name << ", how old are you in years?" << endl;
    int x;
    cin >> x;
    cout << "What year is it now?";
    int year;
    cin >> year;
    cout << "Do you want to compare your age to events in (A) the 2000s or (B) the 2010s? (Enter A or B)";
    string e;
    cin >> e;
   if( e == "A" )
   {
       
       cout << "You sucessfully chose the 2000s." << endl;
       int aa,bb,cc,dd,ee,ff,gg,hh,ii,jj;
       year - 2000 = aa;
       year - 2001 = bb;
       year - 2002 = cc;
       year - 2003 = dd;
       year - 2004 = ee;
       year - 2005 = ff;
       year - 2006 = gg;
       year - 2007 = hh;
       year - 2008 = ii;
       year - 2009 = jj;
       
   }
   else if( e == "B" )
   {
       
       cout << "You sucessfully chose the 2010s." << endl;
       
      
       
   }
   else
   {
       cout << "That answer does not make sense, please try again." << endl;
       ;
      }
    
      }while (wwe==1);
}
UPDATE, I have tried everything, and nothing works. Please help!
aa = year - 2000;
As gwslow pointed out, assignments go right to left, not left to right.
Thanks! The piece now works!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//this code is for determining age relations to events in recent history
#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int main()
{cout << "If you would like to use the program type in 1. If you do not type in 2" << endl;
int wwe;
cin >> wwe;

    do {
    cout << "What is your name?"<< endl;
    string name;
    cin >> name;
    cout << "Okay " << name << ", how old are you in years?" << endl;
    int x;
    cin >> x;
    cout << "What year is it now?";
    int year;
    cin >> year;
    cout << "Do you want to compare your age to events in (A) the 2000s or (B) the 2010s? (Enter A or B)";
    string e;
    cin >> e;
   if( e == "A" )
   {
       
       cout << "You sucessfully chose the 2000s." << endl;
       int aa,bb,cc,dd,ee,ff,gg,hh,ii,jj;
       year - 2000 = aa;
       year - 2001 = bb;
       year - 2002 = cc;
       year - 2003 = dd;
       year - 2004 = ee;
       year - 2005 = ff;
       year - 2006 = gg;
       year - 2007 = hh;
       year - 2008 = ii;
       year - 2009 = jj;
       
   }
   else if( e == "B" )
   {
       
       cout << "You sucessfully chose the 2010s." << endl;
       
      
       
   }
   else
   {
       cout << "That answer does not make sense, please try again." << endl;
       ;
      }
    
      }while (wwe==1);
}
Um, are you sure? You didn't update the code in your post.
Topic archived. No new replies allowed.