Facebook
From Marcin, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 213
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdio.h>
  3. #include <string>
  4. #include <math.h>
  5. #include <stdlib.h>
  6. #include <iostream>
  7. #include <cstdlib>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.         char imie[50];
  14.         char nazwisko[50];
  15.  
  16.                
  17.         int wiek;
  18.         cout << "podaj Imie Nazwisko I wiek" << endl;
  19.         cin >> imie; cin >> nazwisko;cin >> wiek;
  20.         cout << imie<<" " << nazwisko<<" " << wiek  <<endl;
  21.         if (wiek > 100)
  22.                 cout << " Jestes za stary! "<<endl;
  23.         if (wiek < 0)
  24.                 cout << " Nawet sie nie urodziles..." << endl;
  25.         if (((imie[0]) >= 'A')&& ((imie[0]) <= 'Z'))
  26.                 cout << "Imie jest okej."<<endl;
  27.         else
  28.         {
  29.                 cout << "Imie zaczyna sie na mala litere.. poprawiam." << endl;
  30.                 imie[0] = toupper(imie[0]);
  31.                 cout << imie << endl;
  32.        
  33.         }
  34.         if ((nazwisko[0] >= 'A') && (nazwisko[0]) <= 'Z')
  35.                 cout << "Nazwisko jest poprawnie" << endl;
  36.         else
  37.         {
  38.                 cout << "Nazwisko jest bledne... poprawiam." << endl;
  39.                 nazwisko[0] = toupper(nazwisko[0]);
  40.                 cout << nazwisko<<endl;
  41.         }
  42.  
  43.        
  44.  
  45.  
  46.  
  47.  
  48.  
  49.         system("pause");
  50. }