aaaaaaa

From Rock3r, 10 Years ago, written in C++, viewed 708 times.
URL https://paste.godclan.hu/view/zjg5AF74 Embed
Download Paste or View Raw
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <cstdarg>
  4.  
  5. using namespace std;
  6.  
  7. int Alma(int a, ... ) {
  8.      int talal = 0,szam;
  9.      cout << "szamok: 1,4,5,4,6,4,0 ";
  10.      cout << endl;
  11.      cout << "szamod: ";
  12.      cin >> szam;
  13.      va_list t;
  14.      int b = a,kovetkezo;
  15.      kovetkezo = a;
  16.      va_start(t,a);
  17.      if ( kovetkezo == szam ) {
  18.            talal++;
  19.           }
  20.      while ( kovetkezo = va_arg(t, int) ) {
  21.                        if ( kovetkezo == szam ) {
  22.                              talal++;
  23.                             }
  24.                      
  25.                  }
  26.      va_end(t);
  27.      return talal;
  28.     }
  29.  
  30. int main(int argc, char *argv[])
  31. {
  32.     cout << "talatal: " << Alma(1,4,5,4,6,4,0) << endl;
  33.     system("PAUSE");
  34.     return EXIT_SUCCESS;
  35. }
  36.  

Reply to "aaaaaaa"

Here you can reply to the paste above