Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <math.h>
- #include <cstdlib>
- using namespace std;
- int sum_a(int x){
- int sum=0;
- for(int i=0; i<20; i++){
- sum+=*ptrx;
- }
- }
- int main(){
- int A;
- cin >> A;
- int x[20];
- int *ptrx = &x;
- for(int i=0; i<20; i++){
- cin >> x[i];
- }
- int count = 0;
- for(int i=0; i<20; i++){
- if( x[i]==A ){
- count++;
- if(count==2)
- {
- sum_a(int x);
- }
- else
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement