mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
29 lines
491 B
C++
29 lines
491 B
C++
#include <AK/AKString.h>
|
|
#include <AK/QuickSort.h>
|
|
#include <AK/Vector.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
if (argc != 3) {
|
|
printf("usage: tr <from> <to>");
|
|
return 0;
|
|
}
|
|
|
|
char from = argv[1][0];
|
|
char to = argv[2][0];
|
|
|
|
for (;;) {
|
|
char ch = fgetc(stdin);
|
|
if (feof(stdin))
|
|
break;
|
|
if (ch == from)
|
|
putchar(to);
|
|
else
|
|
putchar(ch);
|
|
}
|
|
|
|
return 0;
|
|
}
|