Weil Jimmer's BlogWeil Jimmer's Blog


Category:C++

Found 1 records. At Page 1 / 1.

基本程式語法整理 Python, PHP, JS, Java, C#, C, C++

No Comments
-
更新於 2017-03-04 14:48:03

最近學C、C++,想一塊學,因為大學程式的緣故,我想,我還是先修好了,練習演算法,順便複習以前的程式。我已經語法大混亂了,沒有編譯器糾正我,基本很難寫正確程式,除非最近都在攻某個專案,否則我平時都是一天寫好幾種不同語言的程式,函數偶爾會亂調用。我知道有些工程師很討厭什麼語言都碰一點的人,但,我不管啦,我就是什麼都學,反正最後我也只會主攻少數幾項,也不至於什麼語言都很淺。

PythonPHPJS 
if state:
    #do sth
elif state:
    #do sth
else:
    #do sth
if(state){
    //do sth
}elseif(state){
    //do sth
}else{
    //do sth
}
if(state){
    //do sth
}else if(state){
    //do sth
}else{
    //do sth
}
 
for x in range(0,10):
    #do sth
for($i=0;$i<10;$i++){
    //do sth
}
for(var i=0;i<10;i++){
    //do sth
}
 
for k in arr:
    #do sth
foreach ($arr as $value) {
   //do sth
}
for(var key in arr){
    //value=arr[key];
}
 
Not Existswitch($mod){
    case 1:
       //do sth
    break;
    case 2:
       //do sth
    break;
    default:
       //do sth
}
switch(mod){
    case 1:
       //do sth
    break;
    case 2:
       //do sth
    break;
    default:
       //do sth
}
 
def foo(v1,v2):
    return sth
function foo($v1,$v2){
    return sth;
}

//call by reference

function foo(&$v1,&$v2){
    return sth;
}
function foo(v1,v2){
    return sth;
}
 
JavaC#CC++
if(state){
    //do sth
}else if(state){
    //do sth
}else{
    //do sth
}
if(state){
    //do sth
}else if(state){
    //do sth
}else{
    //do sth
}
if(state){
    //do sth
}else if(state){
    //do sth
}else{
    //do sth
}
if(state){
    //do sth
}else if(state){
    //do sth
}else{
    //do sth
}
for(int i=0;i<10;i++){
    //do sth
}
for(int i=0;i<10;i++){
    //do sth
}
for(i=0;i<10;i++){
    //do sth
}
for(i=0;i<10;i++){
    //do sth
}
for(int k : arr){
    //do sth
}
foreach (int k in arr){
    //do sth
}
Not Existfor(int k : arr){
    //do sth
}
switch(mod){
    case 1:
       //do sth
    break;
    case 2:
       //do sth
    break;
    default:
       //do sth
}
switch(mod){
    case 1:
       //do sth
    break;
    case 2:
       //do sth
    break;
    default:
       //do sth
}
switch(mod){
    case 1:
       //do sth
    break;
    case 2:
       //do sth
    break;
    default:
       //do sth
}
switch(mod){
    case 1:
       //do sth
    break;
    case 2:
       //do sth
    break;
    default:
       //do sth
}
public int foo(int v1, int v2){
    return sth;
}
public int foo(int v1, int v2){
    return sth;
}

//call by reference

public int foo(ref int v1, ref int v2){
    return sth;
}

foo(ref a,ref b);

public int foo(out int v1, out int v2){
    return sth;
}

foo(out a,out b);
int foo(int v1, int v2){
    return sth;
}

//call by reference

int foo(int *v1, int *v2){
    //調用引數都要加*
    return sth;
}

foo(&a,&b);
int foo(int v1, int v2){
    return sth;
}

//call by reference

int foo(int &v1, int &v2){
    return sth;
}

foo(a,b);

//call by pointer

int foo(int *v1, int *v2){
    //調用所有引數都要加*
    return sth;
}

foo(&a,&b);

This entry was posted in C#, C, C++, Java, JS, PHP, Python By Weil Jimmer.

 1 /1 頁)

Visitor Count

pop
nonenonenone

Note

台灣假新聞橫行,沒一家霉體能信的,網軍側翼到處洗風向,堪憂。

毋忘初心,
絕不利慾薰心。

支持網路中立性.
Support Net Neutrality.

飽暖思淫欲,
饑寒起盜心。

支持臺灣實施無條件基本收入

歡迎前來本站。

Words Quiz


Search

Music

Blogging Journey

4465days

since our first blog post.

The strong do what they can and the weak suffer what they must.

Privacy is your right and ability to be yourself and express yourself without the fear that someone is looking over your shoulder and that you might be punished for being yourself, whatever that may be.

It is quality rather than quantity that matters.

I WANT Internet Freedom.

Reality made most of people lost their childishness.

Justice,Freedom,Knowledge.

Without music life would be a mistake.

Support/Donate

This site also need a little money to maintain operations, not entirely without any cost in the Internet. Your donations will be the best support and power of the site.
MethodBitcoin Address
bitcoin1gtuwCjjVVrNUHPGvW6nsuWGxSwygUv4x
buymeacoffee
Register in linode via invitation link and stay active for three months.Linode

Support The Zeitgeist Movement

The Zeitgeist Movement

The Lie We Live

The Lie We Live

The Questions We Never Ask

The Questions We Never Ask

Man

Man

THE EMPLOYMENT

Man

In The Fall

In The Fall

Facebook is EATING the Internet

Facebook

Categories

Android (7)

Announcement (4)

Arduino (2)

Bash (2)

C (3)

C# (5)

C++ (1)

Experience (52)

Flash (2)

Free (13)

Functions (36)

Games (13)

General (60)

Git (2)

HTML (7)

Java (13)

JS (7)

Mood (24)

NAS (2)

Note (32)

Office (1)

OpenWrt (6)

PHP (9)

Privacy (4)

Product (12)

Python (4)

Software (11)

The Internet (25)

Tools (16)

VB.NET (8)

WebHosting (7)

Wi-Fi (5)

XML (4)