请编写一个函数void bubble(double data[],int length),其中data是一维数组,存放比较的数据,length是数组中存放元素的个数,用冒泡法将数据(个数可变)捧序后由小到大输出。冒泡法是常用的排序算法,这种算法执行效率不高,但比较简单,就是将相邻的两个数据作比较,把较小的数据交换到前面。纵向看来,交换过程中较小的数据就好像水中的气泡不断浮起。要求使用for循环实现算法。 注意:部分源程序已存在文件test23_2.cpp中。 请勿修改主函数main和其他函数中的任何内容,仅在函数bubble的花括号中填写若干语句。 文件test23_.cpp的内容如下: #include<iostream.h> void bubble(double data[],int length) void main () int n; cout << "请输入数据的个数"; cin>>n; double* ddata = new double[n]; for(int i = 0; i < n; i++) cout<<"No."<<i+1<<": "; cin>>ddata[i]; bubble (ddata, n); cout<<"排序后输出数据:"<<endl; for(i = O; i<n; i++) cout<<"No."<<i+1<<":"; cout<<ddata[i]<<endl;
The iPod revolutionized the way we consume music. The iPhone made us crazy for apps. And now the iPad is getting ready to rock our love lives—or at least help improve our search for someone to communicate with. In late May, Skout.com will become the first dating site to launch an iPad application. The free app will be similar to the version that’s already available to phone users: members can enter search criteria, such as age range, gender and physical preferences, and a HotMap will show in real time the locations of active Skout users who fit those criteria. The idea is to help members meet up and see if magic happens. The cool thing about the iPad adaptation, says CEO Christian Wiklund, is that its screen is large enough to let the user view the map while simultaneously chatting and searching through another member’s photos. David Evans, editor of onlinedatingpost.com, says we can expect to see more innovative technology in a few months after companies get acquainted with the capabilities of the iPad. "What I’m looking for are dating sites that are optimized for the iPad, with features native to the sleek computing device like (touch screen motions such as) pinch, twist, zoom and shake," he says. "It’s the iPad that’s going to enable developers to create entirely new ways to browse, discover and connect with singles." Steve Odom, CEO and founder of dating site Gelato, which launched last year and includes a live feed of members’ social-media profiles, is redesigning his entire website based on the iPad’s appearance. Profile pictures play a key role in online dating, Odom says, and the iPad gives sites an opportunity to play up the presentation of their clientele. "It’s big, it’s beautiful, and it’s perfect for dating sites," says Odom, who plans to unveil the redesign in June. Evans predicts that online dating sites will begin to display their content like a magazine, letting users flip through pages of profiles and enlarge photos while simultaneously texting with one or more others. He says there’s also been talk of adding a facial-coding and eye-tracking function that would use a webcam on the iPad to refine suggested matches based on a member’s responses to certain profiles. If you grimace, the profile will fade away; if you smile or if your pupils dilate, similar profiles will be suggested. In other words, some day there could be an iPad app for love at first sight. According to David Evans, it’ll be possible that______.
A. iPad becomes the beautiful tool for people to surf the web
B. dating site developers create more ways for people to know each other
C. iPad will be developed to suit the needs of the dating websites
D. developers of iPad will add more features to the device