Created
May 2, 2018 10:37
-
-
Save Zemaaan/a45d88a164955af6b6586abc35ad4456 to your computer and use it in GitHub Desktop.
Programiranje vjezbe 2.5.2018 - 2. zadatak
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ConsoleApplication1.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
void usporedba_duzina(string ime1, string ime2) { | |
if (ime1.length() > ime2.length()) { cout << "Prvo ime je duze od drugog." << endl; } | |
else if (ime2.length() > ime1.length()) { cout << "Drugo ime je duze od prvog." << endl ; } | |
else if (ime1.length() == ime2.length()) { cout << "Imena su jednake duzine." << endl; } | |
} | |
int main() | |
{ | |
string ime1; | |
string ime2; | |
cout << "Upisi prvo ime: " << endl; | |
cin >> ime1; | |
cout << "Upisi druge ime: " << endl; | |
cin >> ime2; | |
usporedba_duzina(ime1,ime2); | |
system("pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment