📄 scanf1.c
字号:
/*
** Line-oriented input processing with sscanf
*/
#include <stdio.h>
#define BUFFER_SIZE 100 /* Longest line we'll handle */
void
function( FILE *input )
{
int a, b, c, d, e;
char buffer[ BUFFER_SIZE ];
while( fgets( buffer, BUFFER_SIZE, input ) != NULL ){
if( sscanf( buffer, "%d %d %d %d %d",
&a, &b, &c, &d, &e ) != 4 ){
fprintf( stderr, "Bad input skipped: %s",
buffer );
continue;
}
/*
** Process this set of input.
*/
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -