1
Dependencies: mbed
main.cpp
00001 #include "mbed.h" 00002 #include "string.h" 00003 #include "stdio.h" 00004 00005 Serial pc(USBTX, USBRX); // tx, rx 00006 00007 //Stringsdrehen 00008 00009 int main() { 00010 while(1) 00011 { 00012 int a=0,lenge; 00013 char speicher1,speicher2; 00014 char wort[100]; 00015 pc.printf("Bitte Wort eingeben\n\r"); 00016 lenge = pc.scanf("%s",&wort); 00017 pc.printf("%s\n\r",wort); 00018 for(int i = 0; i<100; i++) 00019 { 00020 a = 100 - i; 00021 speicher1 = wort[i]; 00022 speicher2 = wort[a]; 00023 wort[i] = speicher2; 00024 if(wort[i] == '\0') 00025 { 00026 lenge = i; 00027 } 00028 } 00029 wort[lenge] = '\0'; 00030 pc.printf("%s\n\r",wort); 00031 } 00032 }
Generated on Tue Aug 23 2022 21:39:48 by
1.7.2