Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int a, x, maxd, i=1, f=1, j=1, n;
- scanf("%d",&a);
- while(i<=a)
- {
- x=a;
- n=i;
- while(j<=i)
- {
- while(n>0)
- {
- n=n-j;
- if(n==0)
- {
- n=-1;
- j=i+1;
- i++;
- }
- }
- j++;
- }
- while(x>0)
- {
- x=x-i;
- if(x==0)
- {
- maxd=i;
- }
- printf("%d\n", maxd);
- }
- i++;
- }
- printf("%d\n", maxd);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement