MIPI_BaseC_WebinarFRTK/18_Seminar05/08_easy_numb_p15.c

26 lines
475 B
C
Raw Permalink Normal View History

2024-11-13 09:22:28 +03:00
#include <stdio.h>
#include <inttypes.h>
int main()
{
uint32_t count=0;
for(uint32_t i=11; i<=999; i++)
{
if ((i < 100) && (i%10 == i/10)) // 11, 22, ...
{
count++;
printf("%" PRIu32 " ",i);
}
else if(i>=100 && i%10 == i/100) // 111, 121, 131, ...
{
count++;
printf("%" PRIu32 " ",i);
}
}
printf("Total polindroms %" PRIu32 "\n",count);
return 0;
}