如何用for循环输出多个5位字母组成的字符串?

vb.net

第1个回答  2011-01-28
给写个示例,下面的应该成。
for i =0 to 100
str = str & "a"
if len(str) = 5
print str
str = ""
end if
next i
第2个回答  2011-01-29
#include<iostream>
#include<ctime>
using namespace std;
int main()
{
srand((unsigned)time(NULL));
char str[51];
int i;
for(i=0;i<50;i++)
{
int n=rand()%26;
str[i]='A'+n;
}
str[i]=0;
cout<<str;
return 0;
}本回答被提问者采纳
相似回答