BEIJING — President Hu Jintao said Thursday that China would lend $20 billion to African governments for infrastructure and agriculture in the next three years, in a speech to a gathering of African leaders.