245B6D9F-A9DE-4B6F-9A91-4E10C107CC7C.jpeg

  1. void solution(char *s1,char *s2){
  2. int i,j;
  3. i=j=0;
  4. while(*s1!='\0'){
  5. if(*s1>'0' && *s1<'9'){
  6. *s2 = *s1;
  7. s2++;
  8. }
  9. s1++;
  10. }
  11. }

F45FB073-E79F-4318-924F-4E7B4204BFF9.jpeg

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int a[20] = {2,3};
  6. int temp = 0;
  7. int i = 2;
  8. while(i<20){
  9. temp = a[i-1]*a[i-2];
  10. //cout<<"temp="<<temp<<endl;
  11. if(temp>=10){
  12. if(i+1<20){
  13. a[i+1]=temp%10;
  14. }
  15. a[i] = temp/10;
  16. i++;
  17. }else{
  18. a[i] = temp;
  19. }
  20. i++;
  21. }
  22. for(int i=0;i<20;i++){
  23. cout<<a[i]<<endl;
  24. } return 0;
  25. }

2018年

2101CC57-CC21-4E38-8B7A-0B185A6B4604.jpeg

  1. #include<iostream>
  2. using namespace std;
  3. void solution_arr(char *a);
  4. void solution_point(char *a);
  5. int main(){
  6. char str[] = "1234567890";
  7. solution_arr(str);
  8. cout<<str<<endl;
  9. return 0;
  10. }
  11. void solution_arr(char *a){
  12. int n=0 ;
  13. char temp;
  14. while(a[++n]!='\0');
  15. for(int i;i<(n+1)/2;i++){
  16. temp = a[i];
  17. a[i] = a[n-i-1];
  18. a[n-i-1] = temp;
  19. }
  20. }