Skip to content

Commit

Permalink
add c solution to statement
Browse files Browse the repository at this point in the history
  • Loading branch information
DAyama committed May 17, 2017
1 parent a3a9e16 commit c8b8920
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion string/statement.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,24 @@ i
## C

```
#include <stdio.h>
#include <string.h>
char buf[200];
int main(int argc, char const *argv[])
{
int T;
scanf("%d", &T);
while(T--){
int n, k;
scanf("%s %d", buf, &k);
n = strlen(buf);
if(k > n)printf("*\n");
else printf("%c\n", buf[k-1]);
}
return 0;
}
```

## Java
Expand Down

0 comments on commit c8b8920

Please sign in to comment.