tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
13
Task/Reverse-a-string/C/reverse-a-string-2.c
Normal file
13
Task/Reverse-a-string/C/reverse-a-string-2.c
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include <glib.h>
|
||||
gchar *srev (const gchar *s) {
|
||||
if (g_utf8_validate(s,-1,NULL)) {
|
||||
return g_utf8_strreverse (s,-1);
|
||||
} }
|
||||
// main
|
||||
int main (void) {
|
||||
const gchar *t="asdf";
|
||||
const gchar *u="as⃝df̅";
|
||||
printf ("%s\n",srev(t));
|
||||
printf ("%s\n",srev(u));
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue