更多"计算机在英文输入状态下,下列字符串中属于合法文件名的是"的相关试题:
[单项选择]根据Windows的文件命名规则,下列字符串合法的文件名是()
A. #CON@.BAT
B. #ASK
C. #ADC*.FNT
D. SAQ/.TXT
[简答题]本程序的功能是,根据用户输入的文件名,在相应的文件内容中查找匹配给定模式的字符串,并将这些字符串显示出来。模式串为“href="…"”。请填写横线处的内容。
注意:请勿改动main( )主方法和其他已有语句内容,仅在横线处填入适当语句。
import java.io.*;
import java.util.regex.*;
import javax.swing.*;
public class Example2_10
{
public static void main(String [] argv)
{
final String patternString =
"href//s*=//s*(/"[^/"]*/"|[^//s>])//s*;
String fileName ;
try
{
System. out. print ( "请输入html 文件的文件名: ");
InputStreamReader in = new InputStreamReader(System.in);
BufferedReader imput = new BufferedReader(in);
fileName = imput.readLine( );
if(fileName.equals(" "))
return;
StringBuffer buffer = new StringBuffer( );
File file = new File(fileName);
FileInputStream readfile = new FileInputStream(file);
for(int c = 0; (c = readfile.read( )) != -1; )
buffer.append((char)c);
Pattern pattern = Pattern.co
[填空题]以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串 :abc123edf456gh,执行程序后输出:123456请填空.
#include <stdio.h>
#include <ctype.h>
main( )
char s[80], d[80]; int i,j;
gets(s);
for (i=j=0;s[i]!=’/0’;i++)
if( ) d[j]=s[i]; j++;
d[j]=’/0’;
puts (d);
[填空题]以下程序的功能是将字符串s中的数字字符放人d数组中,最后输出d中的字符串。例如,输入字符串abc123edf456gh,执行程序后输出123456。请填空。
# include<stdio. h>
# include<ctype. h>
main( )
{ char s[80], d[80]; int i, j;
gets(s);
for(i=j=0; s[i]!=’/0’; i++)
if( 【6】 ){ d[j]=s[i]; j++;)
d[j]=’/0’;
puts(D) ;
}
[填空题]以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。
例如,输入字符串:abc123edf456gh,执行程序后输出:123456。请填空。
#include <stdio.h>
#include <ctype.h>
main( )
{ char s[80],d[80]; int i,j;
gets(s);
for(i=j=0;s[i]! =’/0’;i++)
if( 【9】 ) {d[j]=s[i]; j++;}
d[j]=’/0’;
puts(d);
}
[填空题]以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串:abcl23edf456gh,执行程序后输出:123456。请填空。
#include <stdioo.h>
#include <ctype.h>
main( )
char s[80],d[80]; int i,j;
gets(s);
for(i=j=0;s[i]!=’/0’;i++)
if( 【20】 )d[j]=s[i];j++;
d[j]=’/0’;
puts(d);
[填空题]以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串:
abcl23edf456gh,执行程序后输出:123456。请填空。
#include<stdio.h>
#include<ctype,h>
main( )
char s[80],d[80];int i,j;
gets(s);
for(i=j=0;s[i]!=’/0’;i++)
if( 【20】 )d[j]=s[i];j++;
d[j]=’/0’;
puts(d) ;
[填空题]以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串:abc123edf456gh,执行程序后输出:123456。请填空。
#include <stdio.h>
#include <ctype.h>
main( )
{ char s[80], d[80]; int i,j;
gets(s);
for(i=j=0;s[i]!=’’/0’’;i++)
if(【 】) { d[j]=s[i]; j++; }
d[j]=’’/0’’;
puts(d);
}
[填空题]已知B的ASCII码为66,以下程序统计由键盘输入的字符串中各英文字母的使用次数
Dim【 】
For i=65 To 90
pp(i) =0
Next
x$=InputBox("Enter a string",x$)
x$=UCase$(x$)
For i=1 To【 】
n=Asc(Mid$(x$,i,1))
If n >=65 And n <=90 Then
【 】
End If
Next i
For i=65 To 90
If pp(i) >0 Then
Print Chr$(i);pp(i)
End If
Next
[填空题]在Excel中,为区别“数字”、“数字字符串”,在输入的“数字字符串”前应加上( )符号。
[填空题]已知B的ASCⅡ码为66,以下程序统计由键盘输入的字符串中各英文字母的使用次数。
Dim______
Fori=65 To 90
pp(i)=0
Next
x$=InputBox("Enter a string",K$)
x$=U Case$(x$)
Fori=1 To Len(x$)
n=Asc(Mid$(x$,i,1))
If n>=65Andn<=90Then
______
End If
Nexti
Fori=65 To 90
If pp(i)>Then
Print Chr$(i);pp(i)
End If
Next
[简答题]编写一个函数,用该函数可以统计一个长度为3的字符串在另一个字符串中出现的次数。例如,假定输入字符串“the abcthe they have theren”,子字符串为“the”,则应输出4。
注意:部分源程序在文件PROC2.CPP中。
请勿改动主函数和其他函数中的任何内容,仅在fun( )的花括号中填入编写的若干语句。
部分源程序如下:
//PROC2.CPP
#include <iostream>
using namespace std;
#define MAX 100
int fun(char *str,char *substr);
int main( )
char str[MAX],substr[3];
int n;
cout<<"Please Input the source String/n";
cin>>str;
cout<<"Please Input the subString/n";
cin>>substr;
n=fun(str, substr);
cout<<"The counter is: "<<n<<end1;
return 0;
int fun(char *str,char *substr)
//******