热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_47027124
monkey01127
5 年前
trueweixin_47027124

中年女子程序元

CSDN App 扫码分享
分享
评论
2
打赏
  • 复制链接
  • 举报
下一条:
大佬帮看看#include<iostream> using namespace std; class DIF { public: DIF(int lw, int hi); int isfiff(int x); void process(); void show(); private: int low; int high; int x; int a[100]; int count = 0; }; DIF::DIF(int lw, int hi) { low = lw; x = lw; high = hi; } int DIF::isfiff(int x) { int sum = 0; int x1 = x; int temp; while (x1) { temp = x % 10; x1 /= 10; sum += temp * temp * temp * temp; if (sum == x) return 1; else return 0; } } void DIF::process() { while (x <= high && x >= low) { if (isfiff(x) == 1) { DIF::a[count] = x; count++; } } cout << "共有" << count << "个" << endl; } void DIF::show() { for (int i = 0; i < count - 1; i++) { cout << a[i] << endl; } cout << count << endl; } int main() { DIF dif(1111, 1200); dif.process(); dif.show(); cout << 3 << endl; return 0; }
立即登录