void fun( char *a, char *p ){
char *q=a;
int j=0;
while(*q && q
int isP(int m)
{
int j, tag = 0 ;
for(j = 2 ; j < m && !tag ; j++)
if(m % j == 0) tag = 1 ;
return tag ;
}
void fun( int m, int *k, int xx[] ){
int i, cnt = 0 ;
for(i = 2 ; i < m ; i++)
if(isP(i)) xx[cnt++] = i ;
*k = cnt ;
}
main()
{
int m, n, zz[100];
printf( "\nPlease enter an integer number between 10 and 100: " );
scanf( "%d", &n );
fun( n, &m, zz );
printf( "\n\nThere are %d non-prime numbers less than %d:", m, n );
for( n = 0; n < m; n++ )
printf( "\n %4d", zz[n] );
NONO();
}
NONO()
{
/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,,,,, fun ,,,,
,,,,,?,,,,,?,,, */
int m, n, zz[100];
FILE *rf, *wf ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
fscanf( rf, "%d", &n );
fun( n, &m, zz );
fprintf(wf, "%d\n%d\n", m, n );
for( n = 0; n < m; n++ )
fprintf(wf, "%d\n", zz[n] );
fclose(rf) ;
fclose(wf) ;
}
80.,,,,fun,?,,,,,,,,a,,b,е,},,}λ,,,,,,,,,γ,?,,,µ,,,,,,,,c,С,,,,,?,,,,,,,a,е,,λ,,
,λ,,,4η,,,,c,,,λ,,,λ,,,b,е,,λ,,,λ,,,4η,,?,,c ,?,λ,,,λ,,,?
,,,,,磬a=45, b=12,,,,,øú,,,, c=4251,,#include
void fun(int a, int b, long *c){
*c=(a/10)*1000+(b%10)*100+(a%10)*10+(b/10);
}
main()
{ int a,b; long c;
printf("Input a, b:");
scanf("%d%d", &a, &b);
fun(a, b, &c);
printf("The result is: %ld\n", c);
NONO();
}
NONO ( )
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,ú,,,,,,,,?,,,,,?,,, */
FILE *rf, *wf ;
int i, a,b ; long c ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(rf, "%d,%d", &a, &b) ;
fun(a, b, &c) ;
fprintf(wf, "a=%d,b=%d,c=%ld\n", a, b, c) ;
}
fclose(rf) ;
fclose(wf) ;
}
81.,,,д,,,,fun,,,,,?,,,,,,,,,B=A+A,,,,,,,,,,A,,,,A,,??,ã,,,,,,,,,B,С,,,,,,,,,mai
n,,,,,,,,,
,,,,,,,,,,,磬?,,,,,,?,þ,,,?,,
1 2 3 1 4 7
4 5 6 2 5 8
7 8 9 3 6 9,,,,,,,
2 6 10
6 10 14
10 14 18
#include
void fun ( int a[3][3], int b[3][3]){
int c[3][3] ;
int i, j ;
for(i = 0 ; i < 3 ; i++)
for(j = 0 ; j < 3 ; j++) {
c[i][j] = a[j][i] ; /* ,,,,,?,, */
b[i][j] = a[i][j] + c[i][j] ;
}
}
main( ) /* ,,,,, */
{ int a[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, t[3][3] ;
int i, j ;
fun(a, t) ;
for (i = 0 ; i < 3 ; i++) {
for (j = 0 ; j < 3 ; j++)
printf("%7d", t[i][j]) ;
printf("\n") ;
}
NONO () ;
}
NONO ( )
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,,,,,fun,,,,,,,,,?,,,,,?,,,*/
int i, j, k, a[3][3], t[3][3] ;
FILE *rf, *wf ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(k = 0 ; k < 5 ; k++) {
for(i = 0 ; i < 3 ; i++)
fscanf(rf, "%d %d %d", &a[i][0], &a[i][1], &a[i][2]) ;
fun(a, t) ;
for(i = 0 ; i < 3 ; i++) {
for(j = 0 ; j < 3 ; j++) fprintf(wf, "%7d", t[i][j]) ;
fprintf(wf, "\n") ;
}
}
fclose(rf) ;
fclose(wf) ;
}
82.,,?,?,,,?,,,,,N,,,,,,,,,,,,,,,,,,з,,,,,,,,,,s,У,,,,д,,,,fun,,,?????,,,,,,,,,,,,?,,,,,,,,?,?,,,,,,,,,,?
#include
#define N 16
typedef struct
{ char num[10];
int s;
} STREC;
int fun( STREC a[] )
{
STREC tmp;
int i,j;
for(i = 0; i < N; i++)
for(j = i+1; j < N; j++)
if(a[i].s < a[j].s) {
tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
}
main()
{ STREC s[N]={{"GA005",85},{"GA003",76},{"GA002",69},{"GA004",85},
{"GA001",91},{"GA007",72},{"GA008",64},{"GA006",87},
{"GA015",85},{"GA013",91},{"GA012",64},{"GA014",91},
{"GA011",66},{"GA017",64},{"GA018",64},{"GA016",72}};
int i;FILE *out ;
fun( s );
printf("The data after sorted :\n");
for(i=0;i
void fun(int a, int b, long *c)
{
*c=(b/10)*1000+(a/10)*100+(b%10)*10+(a%10);}
main() /* ,,,, */
{ int a,b; long c;
printf("Input a, b:");
scanf("%d%d", &a, &b);
fun(a, b, &c);
printf("The result is: %ld\n", c);
NONO();
}
NONO ( )
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,ú,,,,,,,,?,,,,,?,,, */
FILE *rf, *wf ;
int i, a,b ; long c ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(rf, "%d,%d", &a, &b) ;
fun(a, b, &c) ;
fprintf(wf, "a=%d,b=%d,c=%ld\n", a, b, c) ;
}
fclose(rf) ;
fclose(wf) ;
}
84.,,,д,,,,fun,,,,,,,,,,,,,,,,
S=1+,,1+,,,2,,+,,1+,,,2+,,,3,,+,,+,,1+,,,2+,,,3+,,+,,,n,,
,,,,,,,,,,磺д,,,,,n,,,,20,,,,,?,,
s=534.188884,,
?,,,,n,?,?,,,,1,,,,,,,,100,,
#include
#include
double fun(int n)
{
int i;
double fac=1.0;
double sum=1.0;
for(i=2;i<=n;i++) {
fac+=sqrt(i);
sum+=fac;
}
return sum;
}
main()
{ int n; double s;
printf("\n\nInput n: "); scanf("%d",&n);
s=fun(n);
printf("\n\ns=%f\n\n",s);
NONO();
}
NONO()
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,,,,, fun ,,,,,,,,,?,,,,,?,,, */
FILE *rf, *wf ; int n, i ; double s ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(rf, "%d", &n) ;
s = fun(n) ;
fprintf(wf, "%lf\n", s) ;
}
fclose(rf) ; fclose(wf) ;
}
85.,,,,fun,?,,,,,,,,},,}λ,,,,,,,,,a,,b,,,,γ,?,,,,,,,,,c,С,,,,,?,,,,,,,a,,,,λ,,,λ
,,,4η,,,c,,,,λ,,,λ,,,b,,,,λ,,,λ,,,4η,,,c,,?,λ,,,λ,,,,,,,,磬a=45 b=12,,,,,,øú,,,, c=4152,,
#include
void fun(int a, int b, long *c)
{
*c=(a/10)*1000+(b/10)*100+(a%10)*10+(b%10);}
main()
{ int a,b; long c;
printf("Input a, b:"); scanf("%d,%d", &a, &b);
fun(a, b, &c);
printf("The result is: %d\n", c);
NONO();
}
NONO ( )
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,ú,,,,,,,,?,,,,,?,,, */
FILE *rf, *wf ;
int i, a,b ; long c ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat", "r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(rf, "%d,%d", &a, &b) ;
fun(a, b, &c) ;
fprintf(wf, "a=%d,b=%d,c=%ld\n", a, b, c) ;
}
fclose(rf) ;
fclose(wf) ;
}
86.,,,д,,,,fun,,,,,,,,,,,,,,,,3,,n,,,,,3,,n,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,磬д,,,,,n,,,,100,,,,,?,,sum=148.874270,,?,,,,n,?,?,,,,2,,,,,,,,100,,
#include
#include
double fun(int n)
{
int i,j=0;
double s=0;
for (i=3; i<=n; i++) {
for (j=2; j
double fun(int n)
{
double s=0, t=1;
int i ;
for(i=1; i<=n; i++) {
t *= i;
s += 1./t;
}
return s;
}
main()
{ int n; double s;
printf("\nInput n: "); scanf("%d",&n);
s=fun(n);
printf("\n\ns=%f\n\n",s);
NONO();
}
NONO()
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,,,,, fun ,,,,,,,,,?,,,,,?,,, */
FILE *rf, *wf ; int n, i ; double s ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(rf, "%d", &n) ;
s = fun(n) ;
fprintf(wf, "%lf\n", s) ;
}
fclose(rf) ; fclose(wf) ;
}
88.,,?,?,,,?,,,,,N,,,,,,,,,,,,,,,,,з,,,,,,,,,,s,У,,,,д,,,,fun,,,,?,,,,,,,,,??????
,,,,,?,,,,,?,,,,b,,?,,,,,,,У,,,,,,,,?,,,,,,,,,,,β,n,,,??,,,,,,,,,,?,,,?,#include
#define N 8
typedef struct
{ char num[10];
double s;
} STREC;
double fun( STREC *a, STREC *b, int *n ){
int i ;
double ave = 0.0 ;
*n = 0 ;
for(i = 0 ; i < N ; i++) ave = ave + a[i].s ;
ave /= N ; /* ,,,,,,,? */
for(i = 0 ; i < N ; i++)
if(a[i].s < ave) { /* ,,,,,,?,?,?,?,,?,b,,?,,,,,,,, */
b[*n]=a[i] ;
(*n)++; /* ,,,,,1 */
}
return ave ; /* ,,,,,,,? */
}
main()
{ STREC s[N]={{"GA05",85},{"GA03",76},{"GA02",69},{"GA04",85},
{"GA01",91},{"GA07",72},{"GA08",64},{"GA06",87}};
STREC h[N],t;FILE *out ;
int i,j,n; double ave;
ave=fun( s,h,&n );
printf("The %d student data which is lower than %7.3f:\n",n,ave);
for(i=0;ih[j].s) {t=h[i] ;h[i]=h[j]; h[j]=t;}
for(i=0;i
#include
int fun(char s[],char c)
{
char *p = s ;
int i = 0 ;
while(*p) {
if(*p != c) s[i++] = *p ;
p++ ;
}
s[i] = 0 ;
}
main()
{
static char str[]="turbo c and borland c++";
char ch;
printf(",,,?,:%s\n", str);
printf(",,,,?,,,?,:");
scanf("%c",&ch);
fun(str,ch);
printf("str[]=%s\n",str);
NONO();
}
NONO()
{
/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,,,,, fun ,,,,
,,,,,?,,,,,?,,, */
FILE *rf, *wf ;
char s[81], ch, w ;
int len ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
fgets(s, 80, rf) ;
fscanf(rf, "%c", &ch) ;
len = strlen(s) - 1 ;
w = s[len] ;
if(w == '\n' || w == 0x1a) s[len] = 0 ;
fun(s, ch) ;
fprintf(wf, "%s", s) ;
fclose(rf) ;
fclose(wf) ;
}
90.,,,д,,,,fun,,,,,,,:,,,,,,,,,,ж,,,,,,?,,Sn=1-1/2+1/3-1/4+,,+1/(2n-1)-1/2n
,,,,,,,,,,磬д,,,,,,,n,,,,8,,,,,?,,s=0.662872,,#include
double fun(int n)
{
int i;
double sum=0.0;
if (n>1 && n<=100) {
for(i=1; i<=n; i++)
sum+=1.0/(2*i-1)-1.0/(2*i);
}
return sum;
}
main()
{ int n; double s;
printf("\nInput n: "); scanf("%d",&n);
s=fun(n);
printf("\ns=%f\n",s);
NONO();
}
NONO()
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,,,,, fun ,,,,,,,,,?,,,,,?,,, */
FILE *rf, *wf ; int n, i ; double s ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(rf, "%d", &n) ;
s = fun(n) ;
fprintf(wf, "%lf\n", s) ;
}
fclose(rf) ; fclose(wf) ;
}
91.,,,д,,,,fun,,,,,,,,,,,,,,,,,,,,,,,,,?9,,,,ÿ,,,,},,,,,,,,,?,,,,,,,,,,,
,,,,,,,,,,磬е,9,,,,,,4,?12.0 34.0 4.0 23.0 34.0 45.0 18.0 3.0 11.0
,,,,,?,,s=35.951014,,?
#include
#include
double fun(double x[9])
{
int i ;
double avg=0.0,sum=0.0;
for (i=0;i<8;i++) {
avg=(x[i]+x[i+1])/2;
sum+=sqrt(avg);
}
return sum;
}
main()
{ double s,a[9]={12.0,34.0,4.0,23.0,34.0,45.0,18.0,3.0,11.0};
int i;
printf("\nThe original data is :\n");
for(i=0;i<9;i++)printf("%6.1f",a[i]); printf("\n\n");
s=fun(a);
printf("s=%f\n\n",s);
NONO();
}
NONO()
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,,,,, fun ,,,,,,,,,?,,,,,?,,, */
FILE *rf, *wf ; int i, j ; double s, a[9] ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 5 ; i++) {
for(j = 0 ; j < 9 ; j++) fscanf(rf, "%lf", &a[j]) ;
s = fun(a) ;
fprintf(wf, "%lf\n", s) ;
}
fclose(rf) ; fclose(wf) ;
}
92.,,,д,,,,,,,,,,,,,,,,,,,10,,,,?,,,
S=,,?,1/10*,,,(Xk-x)2,,,,10,,,,,,,,?,,
,,,,x,,=1/10*,,,,Xk,,
,,,,,,磬10,,,,?95.0 89.0 76.0 65.0 88.0 72.0 85.0 81.0 90.0 56.0
,,,?s=11.730729,,
#include
#include
double fun(double x[10])
{
int i;
double avg=0.0, sum=0.0, abs=0.0, fc;
for (i=0;i<10;i++) sum+=x[i];
avg=sum/10; /* ,,,,,,,? */
for (i=0;i<10;i++)
abs+=(x[i]-avg)*(x[i]-avg);
fc=sqrt(abs/10) ;
return fc;
}
main()
{ double s, x[10]={95.0,89.0,76.0,65.0,88.0,72.0,85.0,81.0,90.0,56.0};
int i;
printf("\nThe original data is :\n");
for(i=0;i<10;i++)printf("%6.1f",x[i]); printf("\n\n");
s=fun(x);
printf("s=%f\n\n",s);
NONO();
}
NONO()
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,,,,, fun ,,,,,,,,,?,,,,,?,,, */
FILE *rf, *wf ; int i, j ; double s, x[10] ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 5 ; i++) {
for(j = 0 ; j < 10 ; j++) fscanf(rf, "%lf", &x[j]) ;
s = fun(x) ;
fprintf(wf, "%lf\n", s) ;
}
fclose(rf) ; fclose(wf) ;
}
93.,,,д,,,,fun,,,,,,,,,,,,},,,?,?,,,,,,,õ,,,C,,,,,,,,,,,?,,,?,,,,,,
,,,,,,?,,,},,,?,,,,,,,,,,?,?,,,?,
,,,,,,,磬beijing shanghai
,,,,,shanghai,,
#include
char *fun ( char *s, char *t)
{
int i;
char *p=s, *q=t;
for(i=0;*p && *q; i++) {
p++; q++;
}
if(*p == 0 && *q == 0) return s ;
if(*p) return s ;
else return t ;
}
main( )
{ char a[20],b[20];
printf("Input 1th string:") ;
gets( a);
printf("Input 2th string:") ;
gets( b);
printf("%s\n",fun (a, b ));
NONO ();
}
NONO ( )
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,ú,,,,,,,,?,,,,,?,,, */
FILE *fp, *wf ;
int i ;
char a[20], b[20] ;
fp = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(fp, "%s %s", a, b) ;
fprintf(wf, "%s\n", fun(a, b)) ;
}
fclose(fp) ;
fclose(wf) ;
}
94.,,,д,,,,fun,,,,,,,,,,,,,,,,,,,ж,,,,,,?,,Sn=1+1/1!+1/2!+1/3!+1/4!+,,.+1/n!
,,,,,,,,,,磬д,,,,,n,,,,15,,,,,,,?,,s=2.718282,,#include
double fun(int n)
{
double s=1 ;
long t=1;
int i;
for(i=1; i<=n; i++) {
t=t*i; /* ,,,,?, */
s+=1./t; /* ,,,,ÿ,,,?,,,,,,q,s,, */?
}
return s; /* ,,,?,,,,,,? */}
main()
{ int n; double s;
printf("Input n: "); scanf("%d",&n);
s=fun(n);
printf("s=%f\n",s);
NONO();
}
NONO()
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,,,,, fun ,,,,,,,,,?,,,,,?,,, */
FILE *rf, *wf ; int n, i ; double s ;
rf = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(rf, "%d", &n) ;
s = fun(n) ;
fprintf(wf, "%lf\n", s) ;
}
fclose(rf) ; fclose(wf) ;
}
95.,,,,,,,,,?,,,?,,,,?,,*,š,,,,д,,,,fun,,,,,,,,,,,,,,?,,,,,,β,,,,*,,,,,,,,,,,,,,,*,,,,,,,,β,h,?,?,,,?,,е,?,,,,?,,,β,b,,?,,,?,,,,,,?
,,,,?,,,,,д,,,,,,,,,,,,,,C,,,,,,,,,?,,,,,,磬,?,,е,,,,,?,,****A*BC*DEF*G******,,,,,?,?,,е,,,,,?,,****ABCDEFG******,,,
,,д,,,,,,,,,,,,,,C,,,,,,,,,?,,,#include
void fun( char *a, char *h,char *p ){
int j=0;
char *q=a;
while(*q && q < h) a[j++] = *q++ ;
while(*h && *p && h < p) {
if(*h != '*') a[j++] = *h ;
h++;
}
while(*p) a[j++] = *p++ ;
a[j] = 0 ;
}
main()
{ char s[81],*t, *f;
printf("Enter a string:\n");gets(s);
t=f=s;
while(*t)t++;
t--;
while(*t=='*')t--;
while(*f=='*')f++;
fun( s , f,t );
printf("The string after deleted:\n");puts(s);
NONO();
}
NONO()
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,ú,,,,,,,,?,,,,,?,,, */
FILE *in, *out ;
int i ; char s[81], *t, *f ;
in = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
out = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(in, "%s", s) ;
t=f=s;
while(*t)t++;
t--;
while(*t=='*')t--;
while(*f=='*')f++;
fun(s, f, t);
fprintf(out, "%s\n", s) ;
}
fclose(in) ;
fclose(out) ;
}
96.,,,д,,,,fun,,,,,,,?,,,
s=,,?,ln(1)+ln(2)+ln(3)+,,+ln(m),,s,,?,,,,?,,,?,
,,C,,,,,п,,,log(n),,,,,,ln(n),,log,,,,,,,,,,,,,,,double log(double x),,?
,,,,,磬m,,??,,20,,fun,,,,??,,6.506583,,#include
#include
double fun( int m )
{
double s = 0.0 ;
int i ;
for(i = 1 ; i <= m ; i++) s += log(1.0 * i) ;
s = sqrt(s) ;
return s ;
}
main()
{
printf("%f\n", fun(20));
NONO();
}
NONO ( )
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,ú,,,,,,,,?,,,,,?,,, */
FILE *fp, *wf ;
int i, n ;
double s ;
fp = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(fp, "%d", &n) ;
s = fun(n) ;
fprintf(wf, "%f\n", s) ;
}
fclose(fp) ;
fclose(wf) ;
}
97.,,?,?,,,?,,,,,N,,,,,,,,,,,,,,,,,,з,,,,,,,,,,s,У,,,,д,,,,fun,,,?????,,,,,,,,,,,?,,,?,,,,,??,,?,,,,,,,,,,,,,,,,,??,,û,?,?,,,,,,?,,?,,,,,,и,,,,ÿ,,,,,,,,,-1,,,,?,,,???,?,,,?,,,,,,,,?,,?,,,,,strcmp,,,,?#include
#include
#define N 16
typedef struct
{ char num[10];
int s;
} STREC;
STREC fun( STREC *a, char *b ){
STREC c ;
int i ;
c.num[0] = '\0' ; /* ,ó,,,,, */
c.s = -1 ; /* ,ó,?-1 */?
for(i = 0 ; i < N ; i++)
if(strcmp(a[i].num, b)==0) { /* ,ж,,,,,,,,, */?
strcpy(c.num, a[i].num) ; /* ,,,,,,,,?,,и?,? */
c.s=a[i].s; /* ,,,,,,,,,,,и?,? */
break ; /* ,,,,,,, */?
}
return c ; /* ,,,,,,,, */?
}
main()
{ STREC s[N]={{"GA005",85},{"GA003",76},{"GA002",69},{"GA004",85},
{"GA001",91},{"GA007",72},{"GA008",64},{"GA006",87},
{"GA015",85},{"GA013",91},{"GA012",64},{"GA014",91},
{"GA011",77},{"GA017",64},{"GA018",64},{"GA016",72}};
STREC h;
char m[10];
int i;FILE *out ;
printf("The original data:\n");
for(i=0; i
#include
void fun ( char *ss )
{
int i ;
for(i = 1 ; i < strlen(*ss) ; i+=2) {
if(ss[i] >= 'a' && ss[i] <= 'z') ss[i] -= 32 ;
}
}
main( )
{ char tt[81] ;
printf( "\nPlease enter an string within 80 characters:\n" ); gets( tt );
printf( "\n\nAfter changing, the string\n \"%s\"", tt );
fun( tt );
printf( "\nbecomes\n \"%s\"\n", tt );
NONO ( );
}
NONO ( )
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,ú,,,,,,,,?,,,,,?,,, */
FILE *fp, *wf ;
char tt[81] ;
int i ;
fp = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(fp, "%s", tt) ;
fun( tt ) ;
fprintf(wf, "%s\n", tt) ;
}
fclose(fp) ;
fclose(wf) ;
}
99.,,?,?,,,?,,,,,N,,,,,,,,,,,,,,,,,,з,,,,,,,,,,s,У,,,,д,,,,fun,,,?????,,,,,,,,,,,,?,,,,,,?,,,,b,,?,,,,,,,У,?,,,,,,,,,,,,,?,,,??,,,,,,,,,,,?,,,,,,,?#include
#define N 16
typedef struct
{ char num[10];
int s;
} STREC;
int fun( STREC *a, STREC *b )
{
int i, max = a[0].s, n=0;
for(i = 1; i < N; i++)
if(max < a[i].s) max = a[i].s ; /* ,?,,,,, */?
for(i = 0; i < N; i++)
if(max==a[i].s) b[n++] = a[i] ; /* ,,,,,,,,,,,,,,,,,,,,b,, */?
return n; /* ,,,?,,,,,,,,,, */
}
main()
{ STREC s[N]={{"GA05",85},{"GA03",76},{"GA02",69},{"GA04",85},
{"GA01",91},{"GA07",72},{"GA08",64},{"GA06",87},
{"GA015",85},{"GA013",91},{"GA012",64},{"GA014",91},
{"GA011",77},{"GA017",64},{"GA018",64},{"GA016",72}};
STREC h[N];
int i,n;FILE *out ;
n=fun( s,h );
printf("The %d highest score :\n",n);
for(i=0;i
float fun(int n)
{
int i,j,t;
float s=0;
for(i=1;i<=n;i++) {
t=0;
for(j=1;j<=i;j++) t+=j;
s=s+1./t;
}
return s;
}
main()
{ int n; float s;
printf("\nPlease enter N:"); scanf("%d", &n);
s = fun(n);
printf("the result is: %f\n", s);
NONO();
}
NONO ( )
{/* ,,,,,,,,,,,,?,,,,,,,,,,,,,,ú,,,,,,,,?,,,,,?,,, */
FILE *fp, *wf ;
int i, n ;
float s;
fp = fopen("C:\\WEXAM\\24990001\\in.dat","r") ;
wf = fopen("C:\\WEXAM\\24990001\\out.dat","w") ;
for(i = 0 ; i < 10 ; i++) {
fscanf(fp, "%d", &n) ;
s = fun(n) ;
fprintf(wf, "%f\n", s) ;
}
fclose(fp) ;
fclose(wf) ;}