Skip to content

Instantly share code, notes, and snippets.

@kainio
Created December 17, 2018 00:40
Show Gist options
  • Save kainio/f3f820c06459b3b4f1bcd15358bc8a66 to your computer and use it in GitHub Desktop.
Save kainio/f3f820c06459b3b4f1bcd15358bc8a66 to your computer and use it in GitHub Desktop.
For Dazi
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
int N = 742;
int centaines = N/100;
int dizaines = N/10 -centaines*10;
int unites = N - centaines*100 - dizaines*10;
printf("N= %d%d%d\n", centaines, dizaines, unites);
printf("N= %d%d%d\n", centaines, unites, dizaines);
printf("N= %d%d%d\n", dizaines, centaines, unites);
printf("N= %d%d%d\n", dizaines, unites, centaines);
printf("N= %d%d%d\n", unites, dizaines, centaines);
printf("N= %d%d%d", unites, centaines, dizaines);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment