Professional Documents
Culture Documents
Chu So Tang Giam
Chu So Tang Giam
Chu So Tang Giam
m
//
#include "stdafx.h"
#include<stdio.h>
#include<conio.h>
void main()
{
int n,t=0;
printf("nhap n:");
scanf_s ("%d",&n);
int c,d=n;
while(d!=0)
{
t++;
d=d/10;
};
printf("so co %d chu so \n",t);
c = n%10;
int z = n/10,x,y;
d = z%10;
if ( d < c)
{
x = z%10;
z = z /10;
y = z%10;
while ( y < x )
{
x = z%10;
z = z /10;
y = z%10;
if (z == 0)
{
printf ("chu so tang dan ");
return;
}
}
printf ("lon xon cmnr \n ");
}
if ( c < d)
{
x = z%10;
z = z /10;
y = z%10;
while ( y > x )
{
x = z%10;
z = z /10;
y = z%10;
if (z == 0)
{
printf ("chu so giam dan \n");
return;
}
}
printf ("lon xon cmnr \n ");
return;
}