Using the scanf function in while loop
问题 I am attempting to format a space-delimited user input for a programming assignment. Essentially, the input consists of an arbitrary number of expressions L integer integer integer integer and C integer integer integer . For example: L 1 1 5 7 C 4 5 3 . So far, I've managed to extract the integers depending on the initial character, and can iterate through the string using the scanf function: char a; while(scanf("%c", &a) == 1){ if(a == 'C'){ int inputX, inputY, inputR; scanf("%d %d %d",