Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4. int main()
  5. {
  6. int i,x;
  7. char str[20];
  8. char masyvas[10][20] = {
  9. "Antanas", "232311",
  10. "Jonas", "232322",
  11. "Petras", "232333",
  12. "Martynas", "232344",
  13. "Darius", "232355"
  14. };
  15.  
  16. while (str != "q"){
  17. cout << "Iveskite varda: ";
  18. cin >> str;
  19.  
  20. for (i = 0; i < 10; i += 2)
  21. if (!strcmp(str, masyvas[i])) {
  22. cout << "Telefono numeris: " << masyvas[i + 1] << "\n";
  23. break;
  24. }
  25. if (i == 10) {
  26. cout << "Numeris nerastas.\n";
  27. }
  28. }
  29.  
  30.  
  31. cin >> i;
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement