ありがちダメなコードのダメな理由を書くコーナー。 #include <stdlib.h> #include <math.h> #include <stdio.h> int mysqrt(int x) { if (x < 0) { return 0; } else { return (int)sqrt(x); } } int main() { printf("%d\n", mysqrt(4)); printf("%d\n", mysqrt(1)); printf("%d\n", m</stdio.h></math.h></stdlib.h>…
引用をストックしました
引用するにはまずログインしてください
引用をストックできませんでした。再度お試しください
限定公開記事のため引用できません。