2017-05-27から1日間の記事一覧

書式

書式 型指定 意味 利用例 %s 文字列 printf("%s","abc"); %d 整数 printf("%d",123); %f 実数 printf("%.f",3.2145); %x 16進数に変換 printf("%x",255); 実行例: <pre></pre>

PHP 基本的な文字列関数  

文字列関数 関数名 説明 trim($str) $strにある前後の空白を除去する strlen($str) 文字列の長さを調べてバイト数で返す substr($str,$start[,$len]) $strで$startから$lenバイトの文字列を返す。 $lenを省略すると、$start以後の全ての文字列を返す。 $star…

C言語 clock ゲーム

#include <time.h> #include <stdio.h> #include <stdlib.h> int main(void) { // insert code here... int a,b,c; int x; clock_t start, end; double req_time; srand(time(NULL)); a = 100 + rand() % 900; b = 100 + rand() % 900; c = 100 + rand() % 900; printf("%d + %d + %dは</stdlib.h></stdio.h></time.h>…