Verification: a143cc29221c9be0

Php ascii code to string

Содержание

C++

#include

using namespace std;

void asciiToSentence(string str, int len)

{

    int num = 0;

    for (int i = 0; i

        num = num * 10 + (str[i] - '0');

        if (num >= 32 && num

            char ch = (char)num;

            cout

            num = 0;

        }

    }

}

int main()

{

    string str = "7110110110711510211111471101101107115";

    int len = str.length();

    asciiToSentence(str, len);

    return 0;

}

Java

class GFG {

    static void asciiToSentence(String str, int len)

    {

        int num = 0;

        for (int i = 0; i

            num = num * 10 + (str.charAt(i) - '0');

            if (num >= 32 && num 122) {

                char ch = (char)num;

                System.out.print(ch);

                num = 0;

            }

        }

    }

    public static void main(String args[])

    {

        String str = "7110110110711510211111471101101107115";

        int len = str.length();

        asciiToSentence(str, len);

    }

}

Python3

def asciiToSentence(string, length) :

    num = 0;

    for i in range(length) :

        num = num * 10 + (ord(string[i]) -

                          ord('0'));

        if (num >= 32 and num = 122) :

            ch = chr(num);

            print(ch, end = "");

            num = 0;

if __name__ == "__main__" :

    string = "7110110110711510211111471101101107115";

    length = len(string);

    asciiToSentence(string, length);

C#

using System;

class GFG {

    static void asciiToSentence(String str, int len)

    {

        int num = 0;

        for (int i = 0; i

            num = num * 10 + (str[i] - '0');

            if (num >= 32 && num

                char ch = (char)num;

                Console.Write(ch);

                num = 0;

            }

        }

    }

    public static void Main()

    {

        String str = "7110110110711510211111471101101107115";

        int len = str.Length;

        asciiToSentence(str, len);

    }

}

PHP

function asciiToSentence($string, $length)

{

    $num = 0;

    for($i = 0; $i $length; $i++)

    {

        $num = $num * 10 + (ord($string[$i]) - ord('0'));

        if ($num >= 32 && $num

        {

            $ch = chr($num);

            print($ch);

            $num = 0;

            }

        }

}

    $string = "7110110110711510211111471101101107115";

    $length = strlen($string);

    asciiToSentence($string, $length);

?>