[ create a new paste ] login | about

Link: http://codepad.org/mMKU6MrS    [ raw code | output | fork ]

C++, pasted on May 9:
#include <iostream>

int main(){

	const int n = 8;

	const char *arr[n] = {
		"aaaa", "ddd", 
		"ffff", "aaa", 
		"dddf", "fff", 
		"dddf", "fff" 
	};

	unsigned res = 0;

	// нулевой элемент будем считать парним...

	for(int i = 0; i < n; ++i){
		if( ! (i & 1) )		
			res += strlen( arr[i] );
	}

	std::cout << "Result: " << res << '\n';

	return 0;
}


Output:
1
Result: 16


Create a new paste based on this one


Comments: