Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
29
Task/CSV-to-HTML-translation/C/csv-to-html-translation-1.c
Normal file
29
Task/CSV-to-HTML-translation/C/csv-to-html-translation-1.c
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include <stdio.h>
|
||||
|
||||
const char *input =
|
||||
"Character,Speech\n"
|
||||
"The multitude,The messiah! Show us the messiah!\n"
|
||||
"Brians mother,<angry>Now you listen here! He's not the messiah; "
|
||||
"he's a very naughty boy! Now go away!</angry>\n"
|
||||
"The multitude,Who are you?\n"
|
||||
"Brians mother,I'm his mother; that's who!\n"
|
||||
"The multitude,Behold his mother! Behold his mother!";
|
||||
|
||||
int main()
|
||||
{
|
||||
const char *s;
|
||||
printf("<table>\n<tr><td>");
|
||||
for (s = input; *s; s++) {
|
||||
switch(*s) {
|
||||
case '\n': printf("</td></tr>\n<tr><td>"); break;
|
||||
case ',': printf("</td><td>"); break;
|
||||
case '<': printf("<"); break;
|
||||
case '>': printf(">"); break;
|
||||
case '&': printf("&"); break;
|
||||
default: putchar(*s);
|
||||
}
|
||||
}
|
||||
puts("</td></tr>\n</table>");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<table>
|
||||
<tr><td>Character</td><td>Speech</td></tr>
|
||||
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
|
||||
<tr><td>Brians mother</td><td><angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry></td></tr>
|
||||
<tr><td>The multitude</td><td>Who are you?</td></tr>
|
||||
<tr><td>Brians mother</td><td>I'm his mother; that's who!</td></tr>
|
||||
<tr><td>The multitude</td><td>Behold his mother! Behold his mother!</td></tr>
|
||||
</table>
|
||||
Loading…
Add table
Add a link
Reference in a new issue