11智能在线
新记
如何用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;
}本回答被提问者采纳
相似回答
大家正在搜
相关问题
用vb编写程序for循环,让用户输入一个字符串,输出这个字符...
用java怎样实现遍历一个字符串的每一个字母
从键盘输入五个由字母组成的字符串,按字母顺序排序输出,不能用...
java 用循环输入 n 行 字符串 而输出 n行字符串
输入一个字符串,用for循环语句读出该字符串。统计其中大写字...
C++编程 输入5个字符串,按英文字典排序,由小到大顺序输出...
输入一串小写字母(a-z)组成的字符串,将连续字母压缩输出字...
求解,将25个字母的字符串数组,如何让其循环组成1000个字...