Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
polja_z3.cpp
00001 #include <iostream> 00002 #include <cstdlib> 00003 00004 00005 using namespace std; 00006 00007 int duzina(char rijec[]){ 00008 int i = 0; 00009 while (rijec[i] != '\0'){ 00010 i++; 00011 } 00012 00013 return i; 00014 } 00015 00016 int main(){ 00017 00018 int duzinaim = 50; 00019 char ime[duzinaim]; 00020 char ime2[duzinaim]; 00021 int chars; 00022 int i, j; 00023 00024 cout << "Upisi svoje ime: "; 00025 cin >> ime; 00026 00027 chars = duzina(ime); 00028 00029 cout << "Tvoje ime je " << chars << " znakova dugacko" << endl; 00030 00031 for (i = 0; i<=duzinaim; i++){ 00032 ime2[i]=ime[i]; 00033 } 00034 00035 cout << ime <<" "<< ime2<< endl; 00036 00037 i = 0; 00038 j = 0; 00039 00040 while (ime2[i] != '\0'){ 00041 ime[j] = ime2[i]; 00042 j++; 00043 ime[j] = '*'; 00044 j++; 00045 i++; 00046 } 00047 ime [j - 1] = '\0'; 00048 00049 cout << ime <<endl; 00050 00051 00052 00053 } 00054
Generated on Thu Jul 14 2022 21:05:48 by
1.7.2