GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Friday, March 18, 2011

CPP - Data Structure

#include <iostream>
#include <string>
#include <cstdlib>
#include <map>
#include <vector>


using namespace std;

int main(int argc, char *argv[]){
    system("color 2f");

    int age;
    float sallary;
    string name, city;
    bool male;
    char code;

    cout << "Your name: ";
    getline(cin,name);
    cout << "\nYour city: ";
    getline(cin, city);
    cout << "\nYour age: ";
    cin >> age;
    cout << "\nYour code: ";
    cin >> code;
    cout << "\nYour sallary: ";
    cin >> sallary;
    cout << "\nYOur gender is male: ";
    cin >> male;

    string gender;
    if(male){
        gender = "Male";
    }else{
        gender = "Female";
    }

    system("cls");
    cout << "Your data: " << endl;
    cout << "Your name: " << name << endl;
    cout << "Your city: " << city << endl;
    cout << "Your age: " << age << " years old" << endl;
    cout << "Your sallary: " << sallary << " dollars" << endl;
    cout << "Your gender: " << gender << endl;
    cout << "Your code: " << code << endl;


    return 0;
}



Share/Bookmark

No comments:

Post a Comment