fork download
  1. static void Main(){
  2. String kata1 = "cat";
  3. String kata2 = "Antartica";
  4.  
  5. Console.WriteLine(punyaHuruf(kata1,kata2));
  6. }
  7.  
  8. static bool punyaHuruf(string kataPertama, string kataKedua){
  9. bool foundAll = true;
  10. bool found = false;
  11.  
  12. for (int i = 0; i < kataPertama.Length; i++){
  13. found = false;
  14.  
  15. for(int j = 0; j < kataKedua.Length; j++){
  16. if(kataPertama[i] == kataKedua[j]){
  17. found = true;
  18. break;
  19. }
  20. }
  21.  
  22. if(found == false)
  23. {
  24. foundAll = false;
  25. break;
  26. }
  27. }
  28. return foundAll;
  29. }
Success #stdin #stdout 0.04s 21756KB
stdin
Standard input is empty
stdout
Standard output is empty