Week 3 hands-on practice project 3-playing pointer on OJ (4)
Problem and code
/** Copyright (c) 2014, School of Computer Science, Yantai University * All rights reserved. * file name: test. cpp * Author: Xin Bin * Completion Date: July 15, December 4, 2014 * version number: v1.0 ** Problem description: The following program, enter two integers, after calling the function ast, the sum of the two numbers and the difference between the two numbers are output. * Input Description: two integers. * Program output: the sum of two numbers and the difference between the two. */# include
Using namespace std; void ast (int x, int y, int * cp, int * dp) {// definition of the completion function * cp = x + y; * dp = x-y;} int main () {int a, B, c, d; cin> a> B; // call the ast (, b, & c, & d); cout <
Running result:
Learning sentiment: continue to change the medicine without changing the changes ....