#include<bits/stdc++.h>
using namespace std;
int sum(int count,...){
int sum=0;
va_list ap;
va_start(ap,count);
for(int i=0;i<count;i++){
sum+=va_arg(ap,int);
}
va_end(ap);
return sum;
}
int main(){
int result=sum(3,1,2,3);
printf("the result is %d\n",result);
return 0;
}