heroys6

Cat

Mar 9th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <unistd.h>
  4. #include <cstdlib>
  5. #include <math.h>
  6.  
  7. using namespace std;
  8.  
  9. void cat_picture1();
  10. void cat_picture2();
  11. void cat_picture3();
  12.  
  13. int main()
  14. {
  15.     cout << "Hi!";
  16.     usleep(pow(10,6));
  17.  
  18.     cout << "\nMy name is YOUR name.";
  19.     usleep(pow(10,6));
  20.  
  21.     cout << "\nI'm intelligent & funny side of your self..)\n";
  22.     usleep(pow(10,6));
  23.  
  24.     for (int i = 0; i < 5; i++){
  25.  
  26.     system("clear");
  27.     cat_picture1();
  28.     usleep(2*pow(10,5));
  29.  
  30.     system("clear");
  31.     cat_picture2();
  32.     usleep(2*pow(10,5));
  33.  
  34.     system("clear");
  35.     cat_picture3();
  36.     usleep(2*pow(10,5));
  37.  
  38.     system("clear");
  39.     cat_picture2();
  40.     usleep(2*pow(10,5));
  41.  
  42.     }
  43.  
  44.     return 0;
  45. }
  46.  
  47. void cat_picture1(){
  48.  
  49.     char buff[99000];
  50.  
  51.     ifstream f("1_cat.txt", ios::binary);
  52.     if (!f) cout << "Error!" << endl;
  53.     else
  54.     {
  55.         int i = 0;
  56.         while (f.get(buff[i])) ++i;
  57.         buff[i] = '\0';
  58.         f.close();
  59.         cout << buff;
  60.     }
  61.     cout << endl;
  62. }
  63.  
  64. void cat_picture2(){
  65.  
  66.     char buff[99000];
  67.  
  68.     ifstream f("2_cat.txt", ios::binary);
  69.     if (!f) cout << "Error!" << endl;
  70.     else
  71.     {
  72.         int i = 0;
  73.         while (f.get(buff[i])) ++i;
  74.         buff[i] = '\0';
  75.         f.close();
  76.         cout << buff;
  77.     }
  78.     cout << endl;
  79. }
  80.  
  81. void cat_picture3(){
  82.  
  83.     char buff[99000];
  84.  
  85.     ifstream f("3_cat.txt", ios::binary);
  86.     if (!f) cout << "Error!" << endl;
  87.     else
  88.     {
  89.         int i = 0;
  90.         while (f.get(buff[i])) ++i;
  91.         buff[i] = '\0';
  92.         f.close();
  93.         cout << buff;
  94.     }
  95.     cout << endl;
  96. }
Advertisement
Add Comment
Please, Sign In to add comment