如何通过cstdio::scanf在一行中读入三个整数

How to read in three integers based in one line by cstdio::scanf?

本文关键字:整数 三个 cstdio 何通过 scanf 一行      更新时间:2023-10-16

我有使用cin/in太慢的数据。每行有三个整数:

1 2 2
3 4 1
5 6 122
6 4 7

如何读入循环中的每一行,以获得结果(对于第一次迭代):

x==1;
y==2;
z==2;
etc.

?

如何使用cstdio::scanf ?

使用

 while(scanf("%d %d %d", &a, &b, &c) != EOF) {
   ... do stuff ...
 }