#include <iostreamの> する#include <STDLIB.H> の#include <math.h>の 書式#include <sstream提供> 名前空間STDを使用して、 ボイドI2S(int型のx、文字列&のbasic_string){ にstringstreamのSS。 SS << X; SS >>のbasic_string。 } BOOLチェック(int型のx、int型XX){ 文字列s_x、s_xx。 I2S(X、s_x)。 I2S(XX、s_xx)。 以下のために(int型私は= 0; I <s_x.length(); ++ I){ 場合(!s_xx.find(s_x [I])= s_xx.npos){ リターンはfalse; } } trueを返します。 } int型のmain(){ int型のX、X2、X3。 文字列SX2、SX3。 {(; X <100 ++ X X = 40)のための X2 = X * X; X3 = X * X * X; (チェック(X2、X3)){もし COUT << X << " "<< X2 <<"" << X3 << ENDL。 } } 0を返します。 }