hw
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#include "stdio.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
int main(){
|
||||
|
||||
int input;
|
||||
printf("input:");
|
||||
scanf("%d", &input);
|
||||
|
||||
// assume 3 digits,
|
||||
|
||||
int d1, d2, d3;
|
||||
d1 = input / 100; //uitgaande van flooring
|
||||
d2 = input % 100 / 10;
|
||||
d3 = input % 10;
|
||||
|
||||
printf("%d%d%d",d3, d2,d1);
|
||||
|
||||
printf("next: ");
|
||||
scanf("%1d%1d%1d", &d1,&d2,&d3);
|
||||
printf("%d%d%d",d3,d2,d1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user