repl.it
@Arabica/

CCP 0.01

C

Just a fun compiler.

fork
loading
Files
  • main.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h> /* For printf() */
#include <string.h> /* For tokenizing and comparing */
#include <stdlib.h> /* For getline() */

int main() {
char input[] = "";
fflush(stdin);
scanf("%c",input);
/*
const char *delim = " ";
const char *delim1 = "(";
const char *delim2 = ")";
const char *delim3 = "\"";
const char *delim4 = "\'";
const char *delim5 = "\n";
*/
char *token = strtok(input, " ");
printf("%s",token);
while(strncmp(&token[strlen(token)], "\n", 1)!=0){
  if(strcmp(token, " ")==0){
    token = strtok(NULL, " ");
    printf("%s", token);
  }
  if(strncmp(token, "print",5)==0){
    token = strtok(NULL, "(");
    printf("%s", token);
  }
	}
}