Advertisement
Hazem3529

Untitled

May 22nd, 2015
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication2
  8. {
  9.     class Program
  10.     {
  11.  
  12.  
  13.         static void Main(string[] args)
  14.         {
  15.                 string gomla = Console.ReadLine();
  16.                 int spaces = 0;
  17.  
  18.                 for (int i = 0; i < gomla.Length; i++)
  19.                 {  
  20.                     if(gomla[i]== ' ') spaces++;
  21.  
  22.                 }
  23.             Console.WriteLine(spaces);
  24.  
  25.         }
  26.  
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement