MIPI_BaseC_WebinarFRTK/18_Seminar05/10_count_p19.c

18 lines
380 B
C
Raw Normal View History

2024-11-13 09:22:28 +03:00
#include <stdio.h>
int main()
{
int i, count = 0;
for (i = 102; i <= 987; i++)
{
int d1 = i % 10;
int d2 = i % 100/10;
int d3 = i / 100;
if (d1!=d2 && d1!=d3 && d2!=d3)
//if (i / 100 != i % 10 && i / 100 != i % 100 / 10 && i % 100 / 10 != i % 10)
count++;
}
printf("%d", count);
return 0;
}