#include <iostream>
using namespace std;
class Figure{
int n;
public:
Figure():n(0){}//无参构造,初始化n为0
void MyGetChar(){
if(n<=9){
cout << n ;
n++;
}
}
};
class Alpha{
char ch;
public:
Alpha():ch('a'){}//无参构造,初始刷ch为'a'
void MyGetChar(){
if(ch<='z'){
cout << ch;
ch++;
}
}
};
int main()
{
Figure f1;
Alpha a1;
for(int i=0;i<26;i++){
f1.MyGetChar();
a1.MyGetChar();
}
return 0;
}
2024.5.3
最新推荐文章于 2024-08-26 16:54:27 发布