Advertisement
kubbur

Untitled

Mar 8th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <stdlib.h>
  3. #include <windows.h>
  4. #include <iostream>
  5. #include <fstream>
  6. #include <vector>
  7. #include <string>
  8. #include <cstdlib>
  9. #include <cmath>
  10. #include <conio.h>
  11. #include <time.h>
  12. #include <MMSystem.h> // Fyrir multi media stuðning
  13. using namespace std;
  14.  
  15.  
  16.  
  17. int main()
  18. {
  19. system("chcp 1252>nul"); // isl stafir
  20.  
  21. cout << "Fýlukallinn" << endl; // titill á leik
  22. // PlaySound(TEXT("game.wav"), NULL, SND_SYNC); /* lærði af youtube þurfti að bæta við input i propertys
  23. // spilar hljóð*/
  24. string valk;//upphafsval
  25.  
  26. cout << "SHALL WE PLAY A GAME?" << endl; // texti ef ekkert audio
  27. cout << "Veldu Y/N (Yes/No)" << endl; //valkostir
  28. cout << ">>";
  29. cin >> valk;
  30.  
  31.  
  32. string txtf;
  33. ifstream txt("ordaskra.txt");
  34.  
  35. if (txt.is_open())
  36. {
  37. string myArray[5];
  38.  
  39. for (int i = 0; i < 5; ++i)
  40. {
  41. txt >> myArray[i];
  42. }
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement