fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int A[]={2,5};
  7. int B[]={3,8};
  8. int C[]={-5,8};
  9. int D[]={5,10};
  10. int E[]={-10,100};
  11. int n=sizeof(A)/sizeof(A[0]);
  12. int count=0;
  13. for(int i=0;i<n;i++){
  14. for(int j=0;j<n;j++){
  15. for(int k=0;k<n;k++){
  16. for(int l=0;l<n;l++){
  17. for(int m=0;m<n;m++){
  18. if(A[i]+B[j]+C[k]+D[l]+E[m]==0){
  19. count=count+1;
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
  26. cout<<"The no of tuplets are:"<<count;
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 5304KB
stdin
Standard input is empty
stdout
The no of tuplets are:2