SHARE
TWEET

Untitled

a guest Jan 21st, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main (){
  5.     int i,m,n,sum,d,start,total,finish=0;
  6.     cin >> m;
  7.     n = m*m;
  8.     d=0;
  9.     int v[n];
  10.     for (i=0;i<n+1; i++){
  11.         v[n] = i;
  12.     }
  13.    
  14.  while (finish =0) {  
  15.     for (i=d;i<n; i++){
  16.         sum = 0;
  17.         sum += i;
  18.         if (sum == n){
  19.             break;
  20.             finish =1;}
  21.         if (sum >n){
  22.             break;
  23.             d++;
  24.              }    
  25.         }
  26.                 }
  27.                
  28. cout <<endl << d <<endl << n;
  29.  
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top