Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- //unos informacija
- cout<<"Unesite informacije o osobama: ime, prezime, maticni" <<endl;
- string ime;
- string prezime;
- string maticnibroj;
- cout<<"Unesite ime osobe: " <<endl;
- cin>>ime;
- cout<<"Unesite prezime osobe: " <<endl;
- cin>>prezime;
- cout<<"Unesite maticni broj osobe: " <<endl;
- cin>>maticnibroj;
- string id;
- id=ime.substr(0,1)+prezime.substr(0,1)+maticnibroj.substr(0,3);
- /* provjeriIme(ime);
- */
- cout<<"ID je "<<id<<endl;
- system("Pause");
- return 0;
- }
- bool provjeriIme(string ime){
- bool provjera=true;
- for(int i=0; i<=ime.length();i++){
- if(!isalpha(ime[i])){
- provjera=false;
- break;
- }else{
- return provjera;
- cout<<"dobra"<<endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment