Advertisement
Guest User

Untitled

a guest
Jun 1st, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <math.h>
  4. #include <cstdlib>
  5. using namespace std;
  6.  
  7. int sum_a(int x){
  8.     int sum=0;
  9.     for(int i=0; i<20; i++){
  10.         sum+=*ptrx;
  11.     }
  12.        
  13. }
  14.  
  15. int main(){
  16.    
  17.     int A;
  18.     cin >> A;
  19.    
  20.     int x[20];
  21.     int *ptrx = &x;
  22.     for(int i=0; i<20; i++){
  23.         cin >> x[i];
  24.  
  25.     }
  26.     int count = 0;
  27.     for(int i=0; i<20; i++){
  28.         if( x[i]==A ){
  29.             count++;
  30.             if(count==2)
  31.             {
  32.             sum_a(int x);  
  33.             }
  34.             else
  35.             {
  36.            
  37.             }
  38.         }
  39.        
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement