count the number of lines, words, and characters within an input

前端 未结 6 1915
礼貌的吻别
礼貌的吻别 2021-01-19 06:20

Right now I am going through a book on C and have come across an example in the book which I cannot get to work.

#include 
#define IN 1
#defin         


        
6条回答
  •  执念已碎
    2021-01-19 06:23

    I usually handle this kind of input like this (for Linux): 1. make a file (for example, named "input.txt"), type your input and save 2. use a pipe to send the text to your application (here assume your application named "a.out" and in the current directory):

    cat input.txt | ./a.out
    

    you'll see the program running correctly.

提交回复
热议问题