home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.disi.unige.it
/
2015-02-11.ftp.disi.unige.it.tar
/
ftp.disi.unige.it
/
pub
/
.person
/
CataniaB
/
teach-act
/
esempi
/
IO
/
esempio-scanf-errata.c
< prev
Wrap
C/C++ Source or Header
|
1997-03-08
|
536b
|
26 lines
/* Esempio di input e ouput formattato */
#include <stdio.h>
#define MAX 20
/*
* La scanf restituisce 1 se l'input e' conforme alla stringa di formato
* altrimenti restituisce 0.
*/
main()
{
int x;
char a[2][MAX];
/*
* Vettore di 2 stringhe, ognuna
* di lunghezza al piu' MAX
*/
if (scanf("Rimpiazza %s con %s",&a[0],&a[1]))
printf("Ecco, ho messo %s al posto di %s!\n",a[1],a[0]);
else printf("Input sbagliato");
}