fixed scanf-test
This commit is contained in:
parent
a37103e1fc
commit
fb0938d2c3
|
@ -50,3 +50,7 @@ modules.order
|
|||
Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
||||
|
||||
# project specific for c-basic
|
||||
huffman/testfiles/*
|
||||
huffman/testfiles/
|
||||
|
|
Binary file not shown.
|
@ -1,2 +1,3 @@
|
|||
#!/bin/bash
|
||||
echo "compiling all files in working directory $(pwd)"
|
||||
for file in $(/bin/ls); do ./compile.sh $file; done
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
name=$(echo "$1" | cut -f 1 -d '.')
|
||||
noext=$(echo "$1" | cut -f 1 -d '.')
|
||||
gcc $1 -o bin/$noext
|
||||
./bin/$noext $2 $3 $4 $5 $6 $7 $8 $9
|
||||
|
|
15
scanf-test.c
15
scanf-test.c
|
@ -1,10 +1,11 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int a;
|
||||
float f;
|
||||
char s[20];
|
||||
scanf("%d %f %s", &a, &f, s);
|
||||
printf("%d %f %s\n", a, f, s);
|
||||
return 0;
|
||||
\n}
|
||||
int a;
|
||||
float f;
|
||||
char s[20];
|
||||
printf("input an integer, a float, then a string.\n");
|
||||
scanf("%d %f %s", &a, &f, s);
|
||||
printf("%d %f %s\n", a, f, s);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue