Horje
there is a string, , of lowercase english letters that is repeated infinitely many times. given an integer, , find and print the number of letter a's in the first letters of the infinite stri
there is a string, , of lowercase english letters that is repeated infinitely many times. given an integer, , find and print the number of letter a's in the first letters of the infinite string.
#inlcude <stdio.h>
/*  I suppose the string is in some kind of file so you just need
	to run your executable with the input coming from that file.
    It can be done by this command:
    ./[executable file] < [input file] */

/*  About the integer that you are being given since is not
	quite clarified how to insert it you can just change
    it from inside the program */

int main(){
	char c;
    int i = 0;
    int x = 10; /* Change x in the desired value */
    
    while( ((c=getchar())!=EOF) && (i<x)){
    	if(c=='a') putchar(c);
        i++;
	}
    
    return 0;
}





C

Related
lazer codechef Code Example lazer codechef Code Example
lognormal distribution - matlab Code Example lognormal distribution - matlab Code Example
character stuffing program in c leadcode Code Example character stuffing program in c leadcode Code Example
rainmaker simple project Code Example rainmaker simple project Code Example
dynamic memory in c Code Example dynamic memory in c Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10