Программа для печати Happy Birthday
Опубликовано: 7 Января, 2022
        After a lot of programming algorithms, it’s turn to wish a programmer friend. Send this code to your coder friend and give him/her a surprise on his/her birthdaY !.
CPP
| // CPP program to print Happy Birthday#include<bits/stdc++.h>usingnamespacestd; intmain(){    // Print first row    charch = "@";    for(inti=1; i<=34; i++)    {        if(i==5||i==7||i==10||i==11||i==14||i==15||           i==16||i==18||i==19||i==20||i==22||i==24)            cout << ch ;        elsecout << " ";     }     // Print second row    cout << endl;    for(inti=1; i<=34; i++)    {        if(i==5||i==7||i==9||i==12||i==14||i==16                ||i==18||i==20||i==22||i==24)            cout << ch ;        elsecout << " ";     }     // Print third row    cout << endl;    for(inti=1; i<=34; i++)    {        if(i==5||i==6||i==7||i==9||i==10||i==11||i==12||            i==14||i==15||i==16||i==18||i==19||i==20||            i==22||i==23||i==24)            cout << ch ;        elsecout << " ";     }     // Print fourth row    cout << endl;    for(inti=1; i<=34; i++)    {        if(i==5||i==7||i==9||i==12||i==14||i==18||i==23)            cout << ch ;        elsecout << " ";     }     // Print fifth row    cout << endl;    for(inti=1; i<=34; i++)    {        if(i==5||i==7||i==9||i==12||i==14||i==18||i==23)            cout << ch ;        elsecout << " ";     }     // Happy is printed, now print    //  birthday row by row    cout << endl;    cout << endl;    cout << endl;    for(inti=1; i<=34; i++)    {        if(i==2||i==3||i==4||i==6||i==7||i==8||i==10||            i==11||i==14||i==15||i==16||i==18||i==20||            i==22||i==23||i==27||i==28||i==31||i==33)            cout << ch ;        elsecout << " ";    }    cout << endl;    for(inti=1; i<=34; i++)    {        if(i==2||i==4||i==7||i==10||i==12||            i==15||i==18||i==20||i==22||i==24||            i==26||i==29||i==31||i==33)            cout << ch ;        elsecout << " ";    }    cout << endl;    for(inti=1; i<=34; i++)    {        if(i==2||i==3||i==4||i==7||i==10||i==11||            i==15||i==18||i==19||i==20||i==22||            i==24||i==26||i==27||i==28||i==29||i==31            ||i==32||i==33)            cout << ch ;        elsecout << " ";    }    cout << endl;    for(inti=1; i<=34; i++)    {        if(i==2||i==4||i==7||i==10||i==12||            i==15||i==18||i==20||i==22||            i==24||i==26||i==29||i==32)            cout << ch ;        elsecout << " ";    }    cout << endl;    for(inti=1; i<=34; i++)    {        if(i==2||i==3||i==4||i==6||i==7||i==8||            i==10||i==12||i==15||i==18||i==20||            i==23||i==22||i==26||i==29||i==32)            cout << ch ;        elsecout << " ";    }    cout << endl;} | 
Java
| // Java program to print// Happy Birthday classGFG{publicstaticvoidmain(String arg[]){    // Print first row    charch = "@";    for(inti=1; i<=34; i++)    {        if(i==5||i==7||i==10||            i==11||i==14||i==15||            i==16||i==18||i==19||            i==20||i==22||i==24)            System.out.print(ch);        elseSystem.out.print(" ");      }      // Print second row    System.out.println();    for(inti=1; i<=34; i++)    {        if(i==5||i==7||i==9||i==12||i==14||i==16                ||i==18||i==20||i==22||i==24)            System.out.print(ch);        elseSystem.out.print(" ");      }      // Print third row    System.out.println();    for(inti=1; i<=34; i++)    {        if(i==5||i==6||i==7||i==9||            i==10||i==11||i==12||            i==14||i==15||i==16||            i==18||i==19||i==20||            i==22||i==23||i==24)            System.out.print(ch) ;        elseSystem.out.print(" ");      }      // Print fourth row    System.out.println();    for(inti=1; i<=34; i++)    {        if(i==5||i==7||i==9||i==12||            i==14||i==18||i==23)            System.out.print(ch);        elseSystem.out.print(" ");      }      // Print fifth row    System.out.println();    for(inti=1; i<=34; i++)    {        if(i==5||i==7||i==9||i==12||            i==14||i==18||i==23)            System.out.print(ch);        elseSystem.out.print(" ");      }      // Happy is printed, now print    // birthday row by row    System.out.println();    System.out.println();    System.out.println();    for(inti=1; i<=34; i++)    {        if(i==2||i==3||i==4||i==6||            i==7||i==8||i==10||            i==11||i==14||i==15||            i==16||i==18||i==20||            i==22||i==23||i==27||            i==28||i==31||i==33)            System.out.print(ch);        elseSystem.out.print(" ");    }     System.out.println();    for(inti=1; i<=34; i++)    {        if(i==2||i==4||i==7||i==10||i==12||            i==15||i==18||i==20||i==22||i==24||            i==26||i==29||i==31||i==33)            System.out.print(ch);        elseSystem.out.print(" ");    }     System.out.println();    for(inti=1; i<=34; i++)    {        if(i==2||i==3||i==4||i==7||            i==10||i==11||            i==15||i==18||i==19||            i==20||i==22||            i==24||i==26||i==27||            i==28||i==29||i==31            ||i==32||i==33)            System.out.print(ch);        elseSystem.out.print(" ");    }     System.out.println();    for(inti=1; i<=34; i++)    {        if(i==2||i==4||i==7||i==10||i==12||            i==15||i==18||i==20||i==22||            i==24||i==26||i==29||i==32)            System.out.print(ch);        elseSystem.out.print(" ");    }     System.out.println();    for(inti=1; i<=34; i++)    {        if(i==2||i==3||i==4||i==6||i==7||i==8||            i==10||i==12||i==15||i==18||i==20||            i==23||i==22||i==26||i==29||i==32)            System.out.print(ch);        elseSystem.out.print(" ");    }     System.out.println();}} // This code is contributed// by Anant Agarwal. | 
Python3
| # Python program to # print Happy Birthday# Print first row ch ="@"fori inrange(1,(34+1)):         if(i==5ori==7ori==10or        i==11ori==14ori==15or        i==16ori==18ori==19or        i==20ori==22ori==24):        print(ch,end="")    else:        print(" ", end="")       # Print second rowprint()fori inrange(1,(34+1)):         if(i==5ori==7ori==9or       i==12ori==14ori==16        ori==18ori==20or       i==22ori==24):        print(ch,end="")    else:        print(" ", end="")  # Print third rowprint()fori inrange(1,(34+1)):         if(i==5ori==6ori==7or        i==9ori==10ori==11ori==12or        i==14ori==15ori==16or        i==18ori==19ori==20or        i==22ori==23ori==24):        print(ch,end="")    else:        print(" ", end="")  # Print fourth rowprint()fori inrange(1,(34+1)):         if(i==5ori==7ori==9ori==12 
            РЕКОМЕНДУЕМЫЕ СТАТЬИ |