fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. }
  14. }
Success #stdin #stdout 0.11s 52572KB
stdin
#include <stdio.h>

int main() {
    char code[] = "int main { int a,b,c; a=10; b=5; c=a+b; return 0; }";
    int i = 0;

    while (code[i] != '\0') {
        // Check for lowercase variable names (a,b,c)
        if (code[i] >= 'a' && code[i] <= 'z') {
            // Only pick single-letter variables a,b,c
            if (code[i] == 'a' || code[i] == 'b' || code[i] == 'c') {
                printf("%c\n", code[i]);
            }
        }
        // Check for numbers
        else if (code[i] >= '0' && code[i] <= '9') {
            while (code[i] >= '0' && code[i] <= '9') {
                printf("%c", code[i]);
                i++;
            }
            printf("\n");
            continue;
        }
        i++;
    }

    return 0;
}
stdout
Standard output is empty