mirror of
https://github.com/Comp211-SP24/lab-01-Rushilwiz.git
synced 2025-04-09 22:40:16 -04:00
chore: formatting
This commit is contained in:
parent
15f7544677
commit
c36c240319
|
@ -1,13 +1,14 @@
|
||||||
// PID: 730677144
|
// PID: 730677144
|
||||||
// I pledge the COMP 211 honor code.
|
// I pledge the COMP 211 honor code.
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
char c;
|
char c;
|
||||||
while ((c = getchar()) != EOF) {
|
while ((c = getchar()) != EOF) {
|
||||||
if (64 < c && c < 91) c += 32;
|
if (64 < c && c < 91)
|
||||||
|
c += 32;
|
||||||
putchar(c);
|
putchar(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// PID: 730677144
|
// PID: 730677144
|
||||||
// I pledge the COMP 211 honor code.
|
// I pledge the COMP 211 honor code.
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
int lines[100];
|
int lines[100];
|
||||||
|
@ -11,16 +11,16 @@ int main() {
|
||||||
total = 0;
|
total = 0;
|
||||||
chars = 0;
|
chars = 0;
|
||||||
cur = 0;
|
cur = 0;
|
||||||
|
|
||||||
while ((c = getchar()) != EOF) {
|
while ((c = getchar()) != EOF) {
|
||||||
chars++;
|
chars++;
|
||||||
|
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
chars = 0;
|
chars = 0;
|
||||||
cur++;
|
cur++;
|
||||||
putchar(c);
|
putchar(c);
|
||||||
} else if (chars > 50) {
|
} else if (chars > 50) {
|
||||||
if (total == 0 || lines[total-1] != cur) {
|
if (total == 0 || lines[total - 1] != cur) {
|
||||||
lines[total] = cur;
|
lines[total] = cur;
|
||||||
total++;
|
total++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user