Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace szavakszama
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool elso;
- int i, k;
- string sz1;
- Console.Write("Ird be a szoveget: ");
- sz1 = Console.ReadLine();
- for(elso = true, i = 0, k = 0; i < sz1.Length; i++)
- {
- if (sz1[i]!=' ')
- {
- if (elso)
- {
- k++; elso = false;
- }
- }
- else
- elso = true;
- }
- Console.WriteLine("A szavak száma: " + k);
- Console.WriteLine("Kólity Kristóf");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement