//This program shows that scanf returns the number of items successfully read in.

/*
Algorithm
1. Declare four integer variables: a, b, and c, which will hold user input, and goodValues,
which will hold how many good values scanf read in.
2. Use printf to tell the user to enter in three integers.
3. Use scanf to read in the three integers in order--the first goes to a, the second goes to b, and the third goes to c.
4. scanf will return how many items it read in successfully. So for example, if I enter in three integers,
scanf returns 3. If I enter in something like 1 5.2 1.3, it will return 2, because it reads 1, puts it into a,
then reads 5 and puts it into b, then sees a . and STOPS because it was looking for another integer and a decimal place isn't supposed to be in an integer
5. Print out the number of good values that scanf
*/

//includes the standard input/output library, which hold the definitions for printf and scanf
#include <stdio.h>

//main is where the program starts
//void means that main takes in nothing
//int means that main will return an integer when it is done
int main(void){

	//declare three integer variables
	int a, b, c;

	//this variable will hold how many good values were read in
	int goodValues;

	//put in instructions
	printf("Please enter three integers, seperated by a space, and press enter.");

	//read in three integer variables seperated by a space
	//scanf returns the number of good values it read in
	//so at the end of this statement, the number of good values scanf read in
	//will be stored in goodValues
	goodValues = scanf("%d %d %d",&a, &b, &c);

	//print out the number of good values that scanf read in
	printf("%d",goodValues);

	return 0;
}
