This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #define MAXLINE 1000 | |
| int ourgetline(char line[], int maxline); | |
| void copy(char to[], char from[]); | |
| main(){ | |
| int len, max; | |
| char line[MAXLINE]; | |
| char longest[MAXLINE]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| //In a word or not | |
| #define IN 1 | |
| #define OUT 0 | |
| #define MAXLENGTH 100 | |
| // Write a program to print a histogram of the lengths of words in its input. It is easy to draw the historgram with the bars horizontal; a vertical orientation is more challenging. | |
| main(){ | |
| //Maximum word length is 100, far more than neccesary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| main(){ | |
| int c; | |
| while((c = getchar()) != EOF){ | |
| if(c == '\n'){ | |
| putchar(' '); | |
| while((c = getchar()) == '\n') | |
| ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| main(){ | |
| int c; | |
| while((c = getchar()) != EOF){ | |
| putchar(c); | |
| if(c == ' '){ | |
| while((c = getchar()) == ' ') | |
| ; | |
| putchar(c); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| //Compile with: $cc counter.c | |
| //run with ./a.out | |
| main(){ | |
| int i; | |
| for (i = 0; i < 10; ++i){ | |
| //The \b is a lesser known escape character that moves the cursor back one. Allowing you to overwrite what you've previously written. | |
| printf("\b%i",i); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.File; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| //Seriously why do I have to import 3 things so get the date. Java = superflous objects everywhere | |
| import java.text.DateFormat; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Calendar; | |
| public final class SimpleLog{ |
NewerOlder