正在加载图片...
int x; cout<<"请输入一个整数,若小于3则重输:"; do cin>x;while( ); int i=2; dol while(x%==0)(cout<<;x/=i;) while(i<x); if(x!=1)cout<<x; cout<<endl; 3.假定有定义为“struct NODE{int data;NODE*next;》;”,下面算法遍历输出以参数 L为表头指针的链表中每个结点的值。 void f6(NODE L) if( return; NODE米p=Li while(p){ cout<<p->data<< p= cout<<endl; 4.类A的定义 class A{ char米a; public: A(){a=0;} 60int x cout< ”请输人一个整数,若小于 3则重输:”; cin>>x; while( i=2; ) O lt O ‘d .1 ‘d while(x%i二=0){cout+ i+ ";x/二 }while(i<x); if (x1=1) cout< x; cout< endl: 3.假定有定义为“struct NODE(int data; NODE* next; } ;",下面算法遍历输出以参数 L为表头指针的链表中每个结点的值 。 void f6(NODE* L) if )return; NODE* P=L; while(p){ cout< p一>data<<} P- ; } cout< endl: 4.类 A的定义 class A { char*a public: A() (a=0; 60
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有