Created
May 2, 2018 11:13
-
-
Save Zemaaan/6a65ed750f7a2e075e48efad240566cb to your computer and use it in GitHub Desktop.
Programiranje vjezbe 2.5.2018 - 4. 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 ispis_duzega_imena_x_puta(string ime1, string ime2) { | |
if (ime1.length() < ime2.length()) { | |
cout << "-------------------------" << endl; | |
for (int pozicija = 0; pozicija < ime1.length(); pozicija++) { | |
cout << ime2 << endl; | |
} | |
} | |
else { | |
cout << "-------------------------" << endl; | |
for (int pozicija = 0; pozicija < ime2.length(); pozicija++) { | |
cout << ime1 << endl; | |
} | |
} | |
} | |
int main() | |
{ | |
string ime1; | |
string ime2; | |
cout << "Upisi prvo ime: " << endl; | |
cin >> ime1; | |
cout << "Upisi druge ime: " << endl; | |
cin >> ime2; | |
ispis_duzega_imena_x_puta(ime1, ime2); | |
cout << "-------------------------" << endl; | |
system("pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment