1. Define an integer array of length 100, assigning the array element to the initial value ... 100, delete all values that are 3 or 7 times times, and the number of remaining digits in the output array and each number.#include intMain () {inti,j,n=0; inta[ -]; for(i=0; i -; i++) { for(j=0; j -; j + +) { if(a[i]%3==0a[i]%7==0) {n++; printf ("%d", A[i])} } Break; } printf ("There are%d numbers left \ n", --N); return 0;} 2. Print 9 rows and 9 columns of matrix
Test instructions: It is to restore into 1,2,3,4,5,6,7,8,0;Analysis: Violent BFS pretreatment, all paths, with comtop expansion weighing, O (1) Print 93ms or very fast.#include #include#include#include#include#include#includeusing namespacestd;Const intn=5005;intfac[]= {1,1,2,6, -, -,720,5040,40320,362880};intaim;intCantorChars[]) { intans=0; for(intI=1, j=8; i9; ++i,--j) {inttmp=0; for(intk=i+1; k9; ++k)if(S[i]>s[k]) + +tmp; Ans+ = (tmp*Fac[j]);
); Else{M[pos]=1-M[pos]; M[pos+1]=1-m[pos+1]; DFS (POS+1, step+1); }}intMain () {CharSTR[MAXN]; scanf ("%s", str); Len=strlen (str); for(intI=0; i){ if(str[i]=='*') m[i]=1; Elsem[i]=0; } scanf ("%s", str); for(intI=0; i){ if(str[i]=='*') s[i]=1; Elses[i]=0; } DFS (0,0); return 0;} With fractionsTitle: With a fraction of 100 can be expressed as a fraction of the form: 100 = 3 + 69258/714 can also be expressed as: 100 = 82 + 3546/197 Note characteristics: With fractions, the number
of the loop will continue to exit recursively, the value of board[i][j] will change, so the results are very strange when the recursion is rolled out.In fact, there is a method at night, the idea is similar, just to change the DFS () function to return the value, but no longer void. This returns true if a workable solution is found, otherwise false is returned.ExercisesclassSolution { Public: BOOLFlag =false;//determine if a workable solution is found BOOLIsValid (vectorChar> > board,intR
) create the best computer self-learning Forum * z7 o-} + {4 W # C9 \, R: K9 ^Echo ON or OFF enables or disables echo. The current echo settings are displayed only when ECHO is used without parameters. 7x0 \ 'x +}. u The echo information is displayed on the screen. 2.Echo information> pass.txt: Save "information" to the pass.txt File .?, S) m2 y) x-x + I9 bwww.520diannao.com Findstr "hello" aa.txt search for the string hello in the aa.txt file. I love
associated with this session. The session id value should be a string that is neither duplicated nor easily found to be regular and counterfeited, this session id will be returned to the client for saving in this response. + I9 B/m/j * L l, Y2 O"L' {# | % G + Q0 P5 B3 C/J9 w BThe cookie can be used to save the session id. In this way, the browser can automatically display the id to the server according to the Rules during the interaction. Generally,
This blog has repeatedly mentioned Mathematica, a super mathematical software, but so far I have not found its Linux version, and wine seems useless. In fact, there are many Mathematica-like mathematical software in Linux, among which maxima is the one I use most. Here, I will briefly introduce various maxima functions for your reference and facilitate future queries.
Install: sudo apt-Get install maxima-shareRun: MaximaExit: Quit ();
Basic operations(%i1) 2+3;(%o1)5(%i2) 5*6;(%o2) 30(%i3) %+2;(
Total time limit:
1000ms
Memory Limit:
65536kB
Describe
There is an apple tree in the Tautau's yard, and 10 apples will be produced in every fall tree. When Apple matures, Tata will run to pick apples. Tata had a 30-centimetre-high bench, and when she couldn't pick it up with her hand, she would step on the bench and try again.
Now that you know the height of 10 apples to the ground and the maximum height you ca
The sorting algorithm and the lookup algorithm are similar, but also related to the iterator interval problem, the note on this issue is not verboseFirst, all sorts sort, stable_sortSort is an unstable sort that needs to include a header file when used algorithmBy default, two or three parameters can be passed. The first parameter is the first address of the interval to sort, and the second is the next address of the interval end address. If only the two addresses are passed in, the specified ad
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.