View difference between Paste ID: fD0Me5L7 and ZyQUg45R
SHOW: | | - or go back to the newest paste.
1
#include <stdio.h>
2
#include <stdlib.h>
3
4
char tab[1000]={0};
5
int x;
6
int i;
7
int y;
8
void tekst(char tab[])
9
{
10
	int i=0;
11
	y=0;
12
    printf("Wpisz dowolny tekst: \n");
13
	
14
	 do
15
    {
16
    	    x=getchar();       
17
            tab[i]=x; 
18
            i++;
19
            y++;
20
             
21
           
22
    } while(x!=10 && i<1000);
23
}
24
25
26
27
28
int znak(char tab[])
29
{
30
	unsigned int a=0;
31
	int i;
32
	for(i=0;i<=y;i++)
33
	{
34
		if(tab[i]==97) a++;
35
		if(tab[i]==10) return a;
36
	}}
37
	
38
   
39
int main()
40
{
41
  int x,y;
42
  tekst(char tab[]);
43
  x=znak(char tab[]); 
44
 
45
  system("PAUSE");   
46
  return 0;
47
}