Posts

Concatenate and Check Perfect Square-Skillrack

Image
  JAVA Solution import java.util.*; public class Hello {     public static void main(String[] args) {         Scanner s = new Scanner(System.in);         String s1 = s.next(), s2 = s.next();         String s3 = s1+s2, s4 = s2+s1;         int x = Integer.parseInt(s3), y = Integer.parseInt(s4);         double x1 = Math.sqrt(x);         if((x1 -Math.floor(x1))==0)         {             System.out.print("Yes");             return;         }         else         {         double x2 = Math.sqrt(y);         if((x2-Math.floor(x2...

Printing X Pattern-Skillrack

Image
C++ Solution #include <iostream> using namespace std; int main(){     int n, i, j, len, k=1, n1;     cin>>n;     len=2*n-1;     n1=n;     for(i=0;i<len;i++)     {         for(j=0;j<len;j++)         {             if(i<n-1)             {                if(j==i||j==len-1-i)                {                    cout<<k;          ...