My c wrong title

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_45697774/article/details/102718084

My summary of the wrong title

Meng new report! Chicken dishes sprouting new summary of the wrong title just set foot ACM tour, recorded some knowledge on the blog, to facilitate the review, if there is an error, please correct me you big brother comments, thank you very much! !
Old driver who took me with
1
/ ordinary year: divisible by 4 but not divisible by 100 are leap years is common.
Century: century divisible by 400 is a leap year.
/
2
simple & 1 does not make sense and may be illegal

But a variable a & 1 is legal meaning and represent a binary 1 and do arithmetic that is the last to see a side of the one who is not 1

Is 1, then (odd) return 1 else return 0

It is not that odd judge it? Equivalent to a% 2 == 0/1, the wording of those two What is the difference? Thanks
are both the same purpose but the efficiency is lower a% 2 & Some fast operation without
3.
GOTO statement is also limited to a function, the function can not jump between. In c language, using the jump function between setjmp and longjmp functions.
4.
n-n-*. 8 = + * p-'0 '; a bit pointer p to go backwards
* p-'0' is a character into a digital, for example, when the point 123 when p is 1, * p = '1' and '1' - '0' is the ASCII code therebetween subtracted,
the result is a 1.
and so

n = 0*8+1=1
n=1*8+2=10
n=10*8+3=83
n=n*2+*p-'0';//二进制转十进制

If multiple sets of input values, pay attention every time you start a new set of time when you want to clear

#include<stdio.h>
#include<math.h>
int main()
{
	int i,j;
	while(scanf("%d%d",&i,&j)!=EOF)
	{
	    int n=0,x=0;/*注意这里要清零*/
		for(i;i<=j;i++)
	  {
	    if(i&1)
			n+=(int)(pow(i,3));
		else
			x+=(int)(pow(i,2));
	  }
	printf("%d %d\n",x,n);
	}
	return 0;
}
   if(m > n) {     // 保证m<=n,以便控制循环
               i = m;
               m = n;
               n = i;
                     }

Like this question, we must be taken to ensure m <= n, to write this step
6. The
% F represents a single precision floating-point data (float),% lf double precision floating-point data (double).
7.
7.1 // calculated and cube: each summation from bit, ten to one hundred

     int sum = 0;
		t = i;
            while(t) {
               int t2 = t % 10;
               sum += t2 * t2 * t2;
               t /= 10; // 去掉个位
            }//取每一位的数
7.2//

The output (not numbered daffodils) and line

     if(count == 0)
            printf("no");
        printf("\n");
	}//如果有要求没有的时候输出no这种要再定义一个变量用于储存目标的个数

8. If the inequality obtained meet requirements of the first n items and, if used for loop and well defined conditions;
9.
If the function does not enter a running requirement of no return the default value of -1
10.
If the unit is required, as is the 50000 5w
it should be this:

scanf("%d%c ",&a,&aa); 
		 
		 if(aa=='w')`在这里插入代码片`
			 a*=10000;

.
Main 'must return' int 'c / c ++ main function must be of type int, and the last to return 0. This is not only effective Luo Gu other topics, but also noip requirements / noi game!
Multi-output can be:

printf("                ********\n"
	"               ************\n"
	"########################################## ############\n" );
	
if(n%a[i][0]!=0) 
		{ 
                cnt[i]=n/a[i][0]+1;  //除完不为零则下面除完要加一(int只舍不入)   
                }         

s

- = c-300 equivalent = S + 300-S C
13 is.

        x=i;
	if(x<min)
	min=x;//如果要求输出的是最小的那么在循环的时候要注意这一点,声明一个min用于储存这一最小值用(if)
        h+=s/100;
	s%=100;//h用于接收s中百位以上的数,用%100即可得到s的后两位


#include<time.h>
	printf(Time used="%.2f\n",(double)clock()/CLOCKS_PER_SEC);
	//求运行时间

Guess you like

Origin blog.csdn.net/weixin_45697774/article/details/102718084