Advertisement
Guest User

Untitled

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