Solução: Problema do giro da palavra (Adson Vinícius)
From AdonaiMedrado.Pro.Br
Revision as of 23:38, 7 April 2009 by 200.17.147.2 (Talk) (New page: <code lang="csharp"> using System; namespace ReverseWord { class MainClass { private static void Main(){ Console.WriteLine("Digite a primeira palavra"); ...)
using System; namespace ReverseWord { class MainClass { private static void Main(){ Console.WriteLine("Digite a primeira palavra"); bool entrou = false; string s1 = Console.ReadLine(); Console.WriteLine("Digite a segunda palavra"); string s2 = Console.ReadLine(); if (s1.Length != s2.Length){ Console.WriteLine(0); } string str; char c; for (int i = 0; i < s1.Length; i++){ c = s1[0]; str = c.ToString(); s1 = s1.Remove(0,1); s1 = s1.Insert(s1.Length, str); if (s1.Equals(s2)){ entrou = true; } } if(entrou){ Console.WriteLine(1); }else{ Console.WriteLine(0); } } } }