基于以下 C 程序框架, 如果输⼊的参数 rows 已经按照 (a,b) 进⾏过排序,对 task1() 的执⾏性能进⾏优化.

基于以下 C 程序框架, 如果输⼊的参数 rows 已经按照 (a,b) 进⾏过排序,对
task1() 的执⾏性能进⾏优化.⽰例输⼊ (再次提醒, 实际输⼊为海量数据),我们希望你实现 task1() 这个函数, 它把 rows 中所有满⾜以下的的⾏的内容都打印到终端,我们期望你打印出的匹配⾏是按照 b 列进⾏排序的.

b >= 10 &&b < 50 并且 a == 1000 || a == 2000 || a == 3000
typedef struct Row
 {
   int a;
   int b;
 } Row;   void
 task1(const Row *rows, int nrows)
 {
   /*
  * TODO: implement this function.
   */
 }
示例输出:
1 2000,22
2 1000,31
3 2000,33



```c
#include <stdio.h>

typedef struct Row {
  int a;
  int b;
} Row;

void task1(const Row *rows, int nrows) {
  int i = 0;

  // 找到满足条件的起始位置
  while (i < nrows && rows[i].b < 10) {
    i++;
  }

  // 输出满足条件的行内容
  while (i < nrows && rows[i].b < 50) {
    if ((rows[i].a == 1000 || rows[i].a == 2000 || rows[i].a == 3000)) {
      printf("%d %d,%d\n", i+1, rows[i].a, rows[i].b);
    }
    i++;
  }
}

int main() {
  // 示例输入数据
  Row rows[] = {
    {2000, 22},
    {1000, 31},
    {2000, 33},
    {3000, 35},
   


```