字串相關操作————2015小米筆試內容,字串2015小米筆試

來源:互聯網
上載者:User

字串相關操作————2015小米筆試內容,字串2015小米筆試

這個是一道小米公司2015的筆試題:

迴文數:一個字串從前看和從後看如果一樣的話,就是迴文串。比如“上海自來水來自上海”就是一個迴文串。現在,把一個數字看成一個字串,問他是不是一個迴文數?

如:12321 -> true   3->ture 133434-> false


#include<stdio.h>#include<stdlib.h>bool isPalindromeNumber(long num){long temp = num;long x=0;while(temp!=0){x = temp%10 + x*10;temp = temp/10;}if(x == num){return true;}else{return false;}}int main(){long test1=12344321;long test2=1234567;bool re1,re2;re1 = isPalindromeNumber(test1);re2 = isPalindromeNumber(test2);printf("%d\n%d\n",re1,re2);system("pause");return 0;}



小米3到2015年2月多少元?

肯定不會超過200!
 
小米4到2015年2月貴不?

價格會維持在1999元,除非出了小米5
您可以關注我們喬幫主瞭解更多動態和每天的售價報
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.