Korisničko ime-rešenje
#include <iostream>
#include<string>
#include<math.h>
using namespace std;
int main()
{
string username;
cin>> username; //User enters his username
int X;
X=username.length(); // Length of user name
if(X<=6){
cout<<"No username created. You miss"<<fabs(X-7)<<" letters."<<endl;
}
else if(X>=14){
cout<<"No user name created. You have "<<X-13<<" more letters ."<<endl;
}
else{
cout<<"Created a username for the user"<<username<<"."<<endl;
}
return 0;
}
#include<string>
#include<math.h>
using namespace std;
int main()
{
string username;
cin>> username; //User enters his username
int X;
X=username.length(); // Length of user name
if(X<=6){
cout<<"No username created. You miss"<<fabs(X-7)<<" letters."<<endl;
}
else if(X>=14){
cout<<"No user name created. You have "<<X-13<<" more letters ."<<endl;
}
else{
cout<<"Created a username for the user"<<username<<"."<<endl;
}
return 0;
}
© 2019 by Slobodan izprogramiranja.weebly.com
All rights reserved